Skip to content

Commit b6fb4ec

Browse files
chore: Update templated files (f1f1a9e) (#706)
* chore: Generated commit to update templated files since the last template run up to stackabletech/operator-templating@f1f1a9e Reference-to: stackabletech/operator-templating@f1f1a9e (Bump Rust to 1.85.0) * fix: rustfmt lint * ci: use nightly toolchain for cargo udeps * ci: use nightly toolchain for cargo udeps * Revert "ci: use nightly toolchain for cargo udeps" This reverts commit 65681d4. * Revert "ci: use nightly toolchain for cargo udeps" This reverts commit edf5fb3. --------- Co-authored-by: Nick Larsen <[email protected]>
1 parent 8742c2f commit b6fb4ec

23 files changed

+154
-140
lines changed

.github/PULL_REQUEST_TEMPLATE/pre-release-rust-deps.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Bump Rust Dependencies for Stackable Release XX.(X)X
1+
# Bump Rust Dependencies for Stackable Release YY.M.X
22

33
<!--
44
Make sure to update the link in 'issues/.github/ISSUE_TEMPLATE/pre-release-operator-rust-deps.md'
@@ -32,7 +32,7 @@ Part of <https://github.com/stackabletech/issues/issues/TRACKING_ISSUE>
3232
3333
```[tasklist]
3434
### Bump Rust Dependencies
35-
- [ ] Bump `stackable-operator` and friends.
36-
- [ ] Bump `product-version`.
37-
- [ ] Bump all other dependencies.
35+
- [ ] Bump `stackable-operator` and friends
36+
- [ ] Bump `product-config`
37+
- [ ] Bump all other dependencies
3838
```

.github/workflows/build.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ env:
2626
CARGO_TERM_COLOR: always
2727
CARGO_INCREMENTAL: '0'
2828
CARGO_PROFILE_DEV_DEBUG: '0'
29-
RUST_TOOLCHAIN_VERSION: "1.84.1"
29+
RUST_TOOLCHAIN_VERSION: "1.85.0"
30+
RUST_NIGHTLY_TOOLCHAIN_VERSION: "nightly-2025-01-15"
3031
PYTHON_VERSION: "3.12"
3132
RUSTFLAGS: "-D warnings"
3233
RUSTDOCFLAGS: "-D warnings"
@@ -136,9 +137,11 @@ jobs:
136137
submodules: recursive
137138
- uses: dtolnay/rust-toolchain@c5a29ddb4d9d194e7c84ec8c3fba61b1c31fee8c
138139
with:
139-
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
140+
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN_VERSION }}
140141
components: rustfmt
141-
- run: cargo fmt --all -- --check
142+
- env:
143+
RUST_TOOLCHAIN_VERSION: ${{ env.RUST_NIGHTLY_TOOLCHAIN_VERSION }}
144+
run: cargo "+$RUST_TOOLCHAIN_VERSION" fmt --all -- --check
142145

143146
run_clippy:
144147
name: Run Clippy

.vscode/settings.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"rust-analyzer.rustfmt.overrideCommand": [
3+
"rustfmt",
4+
"+nightly-2025-01-15",
5+
"--"
6+
],
7+
}

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# DO NOT EDIT, this file is generated by operator-templating
22
[toolchain]
3-
channel = "1.84.1"
3+
channel = "1.85.0"

rust/operator-binary/src/authentication/ldap.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ use std::collections::BTreeMap;
22

33
use snafu::ResultExt;
44
use stackable_operator::{
5-
builder::pod::{container::ContainerBuilder, PodBuilder},
5+
builder::pod::{PodBuilder, container::ContainerBuilder},
66
commons::authentication::ldap::AuthenticationProvider,
77
};
88

99
use crate::{
1010
authentication::{
1111
AddLdapVolumesSnafu, ConstructLdapEndpointUrlSnafu, Error, MissingLdapBindCredentialsSnafu,
1212
},
13-
crd::security::{add_cert_to_trust_store_cmd, STACKABLE_TLS_DIR, TLS_STORE_PASSWORD},
13+
crd::security::{STACKABLE_TLS_DIR, TLS_STORE_PASSWORD, add_cert_to_trust_store_cmd},
1414
};
1515

1616
fn add_authenticator_config(

rust/operator-binary/src/authentication/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::BTreeMap;
22

33
use snafu::Snafu;
44
use stackable_operator::{
5-
builder::pod::{container::ContainerBuilder, PodBuilder},
5+
builder::pod::{PodBuilder, container::ContainerBuilder},
66
commons::{
77
authentication::{
88
ldap::AuthenticationProvider as LdapAuthenticationProvider,
@@ -17,9 +17,10 @@ use stackable_operator::{
1717

1818
use crate::{
1919
crd::{
20+
DruidRole,
2021
authentication::{AuthenticationClassResolved, AuthenticationClassesResolved},
2122
security::{ESCALATOR_INTERNAL_CLIENT_PASSWORD_ENV, INTERNAL_INITIAL_CLIENT_PASSWORD_ENV},
22-
v1alpha1, DruidRole,
23+
v1alpha1,
2324
},
2425
internal_secret::{build_shared_internal_secret_name, env_var_from_secret},
2526
};

rust/operator-binary/src/authentication/oidc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ use std::collections::BTreeMap;
22

33
use snafu::ResultExt;
44
use stackable_operator::{
5-
builder::pod::{container::ContainerBuilder, PodBuilder},
5+
builder::pod::{PodBuilder, container::ContainerBuilder},
66
commons::authentication::oidc::{AuthenticationProvider, ClientAuthenticationOptions},
77
k8s_openapi::api::core::v1::EnvVar,
88
};
99

1010
use crate::{
1111
authentication::{AddOidcVolumesSnafu, ConstructOidcWellKnownUrlSnafu, Error},
12-
crd::{security::add_cert_to_jvm_trust_store_cmd, DruidRole, COOKIE_PASSPHRASE_ENV},
12+
crd::{COOKIE_PASSPHRASE_ENV, DruidRole, security::add_cert_to_jvm_trust_store_cmd},
1313
internal_secret::env_var_from_secret,
1414
};
1515

rust/operator-binary/src/config/jvm.rs

+8-20
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ mod tests {
132132
let coordinator_jvm_config = construct_jvm_config_for_test(input, &DruidRole::Coordinator);
133133
let historical_jvm_config = construct_jvm_config_for_test(input, &DruidRole::Historical);
134134

135-
assert_eq!(
136-
coordinator_jvm_config,
137-
indoc! {"
135+
assert_eq!(coordinator_jvm_config, indoc! {"
138136
-server
139137
-Xmx468m
140138
-Xms468m
@@ -149,11 +147,8 @@ mod tests {
149147
-Djavax.net.ssl.trustStore=/stackable/truststore.p12
150148
-Djavax.net.ssl.trustStorePassword=changeit
151149
-Djavax.net.ssl.trustStoreType=pkcs12
152-
-Dderby.stream.error.file=/stackable/var/druid/derby.log"}
153-
);
154-
assert_eq!(
155-
historical_jvm_config,
156-
indoc! {"
150+
-Dderby.stream.error.file=/stackable/var/druid/derby.log"});
151+
assert_eq!(historical_jvm_config, indoc! {"
157152
-server
158153
-Xmx900m
159154
-Xms900m
@@ -168,8 +163,7 @@ mod tests {
168163
-Dlog4j.configurationFile=/stackable/rwconfig/log4j2.properties
169164
-Djavax.net.ssl.trustStore=/stackable/truststore.p12
170165
-Djavax.net.ssl.trustStorePassword=changeit
171-
-Djavax.net.ssl.trustStoreType=pkcs12"}
172-
);
166+
-Djavax.net.ssl.trustStoreType=pkcs12"});
173167
}
174168

175169
#[test]
@@ -243,9 +237,7 @@ mod tests {
243237
let coordinator_jvm_config = construct_jvm_config_for_test(input, &DruidRole::Coordinator);
244238
let historical_jvm_config = construct_jvm_config_for_test(input, &DruidRole::Historical);
245239

246-
assert_eq!(
247-
coordinator_jvm_config,
248-
indoc! {"
240+
assert_eq!(coordinator_jvm_config, indoc! {"
249241
-server
250242
-Xms42708m
251243
-XX:+ExitOnOutOfMemoryError
@@ -263,11 +255,8 @@ mod tests {
263255
-Dhttps.proxyHost=proxy.my.corp
264256
-Djava.net.preferIPv4Stack=true
265257
-Xmx40000m
266-
-Dhttps.proxyPort=1234"}
267-
);
268-
assert_eq!(
269-
historical_jvm_config,
270-
indoc! {"
258+
-Dhttps.proxyPort=1234"});
259+
assert_eq!(historical_jvm_config, indoc! {"
271260
-server
272261
-Xmx9759m
273262
-Xms9759m
@@ -283,8 +272,7 @@ mod tests {
283272
-Djavax.net.ssl.trustStore=/stackable/truststore.p12
284273
-Djavax.net.ssl.trustStorePassword=changeit
285274
-Djavax.net.ssl.trustStoreType=pkcs12
286-
-Dfoo=bar"}
287-
);
275+
-Dfoo=bar"});
288276
}
289277

290278
fn construct_jvm_config_for_test(druid_cluster: &str, druid_role: &DruidRole) -> String {

rust/operator-binary/src/crd/affinity.rs

+36-42
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use stackable_operator::{
2-
commons::affinity::{affinity_between_role_pods, StackableAffinityFragment},
2+
commons::affinity::{StackableAffinityFragment, affinity_between_role_pods},
33
k8s_openapi::api::core::v1::{PodAffinity, PodAntiAffinity},
44
};
55

6-
use crate::crd::{DeepStorageSpec, DruidRole, HdfsDeepStorageSpec, APP_NAME};
6+
use crate::crd::{APP_NAME, DeepStorageSpec, DruidRole, HdfsDeepStorageSpec};
77

88
/// Please have a look at the architecture diagram in <https://druid.apache.org/assets/images/druid-architecture-7db1cd79d2d70b2e5ccc73b6bebfcaa4.svg>
99
/// to understand which roles do communicate with each other.
@@ -257,45 +257,39 @@ mod tests {
257257
_ => (),
258258
};
259259

260-
assert_eq!(
261-
merged_config.affinity,
262-
StackableAffinity {
263-
pod_affinity: Some(PodAffinity {
264-
preferred_during_scheduling_ignored_during_execution: Some(expected_affinities),
265-
required_during_scheduling_ignored_during_execution: None,
266-
}),
267-
pod_anti_affinity: Some(PodAntiAffinity {
268-
preferred_during_scheduling_ignored_during_execution: Some(vec![
269-
WeightedPodAffinityTerm {
270-
pod_affinity_term: PodAffinityTerm {
271-
label_selector: Some(LabelSelector {
272-
match_expressions: None,
273-
match_labels: Some(BTreeMap::from([
274-
("app.kubernetes.io/name".to_string(), "druid".to_string(),),
275-
(
276-
"app.kubernetes.io/instance".to_string(),
277-
"simple-druid".to_string(),
278-
),
279-
(
280-
"app.kubernetes.io/component".to_string(),
281-
role.to_string(),
282-
)
283-
]))
284-
}),
285-
match_label_keys: None,
286-
mismatch_label_keys: None,
287-
namespace_selector: None,
288-
namespaces: None,
289-
topology_key: "kubernetes.io/hostname".to_string(),
290-
},
291-
weight: 70
292-
}
293-
]),
294-
required_during_scheduling_ignored_during_execution: None,
295-
}),
296-
node_affinity: None,
297-
node_selector: None,
298-
}
299-
);
260+
assert_eq!(merged_config.affinity, StackableAffinity {
261+
pod_affinity: Some(PodAffinity {
262+
preferred_during_scheduling_ignored_during_execution: Some(expected_affinities),
263+
required_during_scheduling_ignored_during_execution: None,
264+
}),
265+
pod_anti_affinity: Some(PodAntiAffinity {
266+
preferred_during_scheduling_ignored_during_execution: Some(vec![
267+
WeightedPodAffinityTerm {
268+
pod_affinity_term: PodAffinityTerm {
269+
label_selector: Some(LabelSelector {
270+
match_expressions: None,
271+
match_labels: Some(BTreeMap::from([
272+
("app.kubernetes.io/name".to_string(), "druid".to_string(),),
273+
(
274+
"app.kubernetes.io/instance".to_string(),
275+
"simple-druid".to_string(),
276+
),
277+
("app.kubernetes.io/component".to_string(), role.to_string(),)
278+
]))
279+
}),
280+
match_label_keys: None,
281+
mismatch_label_keys: None,
282+
namespace_selector: None,
283+
namespaces: None,
284+
topology_key: "kubernetes.io/hostname".to_string(),
285+
},
286+
weight: 70
287+
}
288+
]),
289+
required_during_scheduling_ignored_during_execution: None,
290+
}),
291+
node_affinity: None,
292+
node_selector: None,
293+
});
300294
}
301295
}

rust/operator-binary/src/crd/authentication.rs

+18-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
use std::future::Future;
22

3-
use snafu::{ensure, ResultExt, Snafu};
3+
use snafu::{ResultExt, Snafu, ensure};
44
use stackable_operator::{
55
client::Client,
66
commons::authentication::{
7-
ldap,
7+
AuthenticationClass, AuthenticationClassProvider, ClientAuthenticationDetails, ldap,
88
oidc::{self, IdentityProviderHint},
9-
tls, AuthenticationClass, AuthenticationClassProvider, ClientAuthenticationDetails,
9+
tls,
1010
},
11-
kube::{runtime::reflector::ObjectRef, ResourceExt},
11+
kube::{ResourceExt, runtime::reflector::ObjectRef},
1212
};
1313
use tracing::info;
1414

@@ -33,22 +33,24 @@ pub enum Error {
3333
#[snafu(display("only one authentication class is currently supported at a time."))]
3434
MultipleAuthenticationClassesNotSupported,
3535
#[snafu(display(
36-
"failed to use authentication provider [{authentication_class_provider}] for authentication class [{authentication_class}] - supported providers: {SUPPORTED_AUTHENTICATION_CLASS_PROVIDERS:?}",
36+
"failed to use authentication provider [{authentication_class_provider}] for authentication class [{authentication_class}] - supported providers: {SUPPORTED_AUTHENTICATION_CLASS_PROVIDERS:?}",
3737
))]
3838
AuthenticationClassProviderNotSupported {
3939
authentication_class_provider: String,
4040
authentication_class: ObjectRef<AuthenticationClass>,
4141
},
42-
#[snafu(display("LDAP authentication without bind credentials is currently not supported. See https://github.com/stackabletech/druid-operator/issues/383 for details"))]
42+
#[snafu(display(
43+
"LDAP authentication without bind credentials is currently not supported. See https://github.com/stackabletech/druid-operator/issues/383 for details"
44+
))]
4345
LdapAuthenticationWithoutBindCredentialsNotSupported {},
4446
#[snafu(display("LDAP authentication requires server and internal tls to be enabled"))]
4547
LdapAuthenticationWithoutServerTlsNotSupported {},
4648
#[snafu(display(
47-
"client authentication using TLS (as requested by AuthenticationClass {auth_class_name}) can not be used when Druid server and internal TLS is disabled",
49+
"client authentication using TLS (as requested by AuthenticationClass {auth_class_name}) can not be used when Druid server and internal TLS is disabled",
4850
))]
4951
TlsAuthenticationClassWithoutDruidServerTls { auth_class_name: String },
5052
#[snafu(display(
51-
"client authentication using TLS (as requested by AuthenticationClass {auth_class_name}) can only use the same SecretClass as the Druid instance is using for server and internal communication (SecretClass {server_and_internal_secret_class} in this case)",
53+
"client authentication using TLS (as requested by AuthenticationClass {auth_class_name}) can only use the same SecretClass as the Druid instance is using for server and internal communication (SecretClass {server_and_internal_secret_class} in this case)",
5254
))]
5355
TlsAuthenticationClassSecretClassDiffersFromDruidServerTls {
5456
auth_class_name: String,
@@ -58,7 +60,9 @@ pub enum Error {
5860
OidcConfigurationInvalid {
5961
source: stackable_operator::commons::authentication::Error,
6062
},
61-
#[snafu(display("the OIDC provider {oidc_provider:?} is not yet supported (AuthenticationClass {auth_class_name:?})"))]
63+
#[snafu(display(
64+
"the OIDC provider {oidc_provider:?} is not yet supported (AuthenticationClass {auth_class_name:?})"
65+
))]
6266
OidcProviderNotSupported {
6367
auth_class_name: String,
6468
oidc_provider: String,
@@ -186,8 +190,11 @@ impl AuthenticationClassesResolved {
186190
) -> Result<AuthenticationClassResolved> {
187191
let oidc_provider = match &provider.provider_hint {
188192
None => {
189-
info!("No OIDC provider hint given in AuthClass {auth_class_name}, assuming {default_oidc_provider_name}",
190-
default_oidc_provider_name = serde_json::to_string(&DEFAULT_OIDC_PROVIDER).unwrap());
193+
info!(
194+
"No OIDC provider hint given in AuthClass {auth_class_name}, assuming {default_oidc_provider_name}",
195+
default_oidc_provider_name =
196+
serde_json::to_string(&DEFAULT_OIDC_PROVIDER).unwrap()
197+
);
191198
DEFAULT_OIDC_PROVIDER
192199
}
193200
Some(oidc_provider) => oidc_provider.to_owned(),

rust/operator-binary/src/crd/memory.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use stackable_operator::{
88
};
99

1010
use crate::crd::{
11-
storage::HistoricalStorage, PROCESSING_BUFFER_SIZE_BYTES, PROCESSING_NUM_MERGE_BUFFERS,
12-
PROCESSING_NUM_THREADS,
11+
PROCESSING_BUFFER_SIZE_BYTES, PROCESSING_NUM_MERGE_BUFFERS, PROCESSING_NUM_THREADS,
12+
storage::HistoricalStorage,
1313
};
1414

1515
static MIN_HEAP_RATIO: f32 = 0.75;

rust/operator-binary/src/crd/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ use stackable_operator::{
3535
status::condition::{ClusterCondition, HasStatusCondition},
3636
time::Duration,
3737
utils::{
38-
cluster_info::KubernetesClusterInfo, crds::raw_object_list_schema,
39-
COMMON_BASH_TRAP_FUNCTIONS,
38+
COMMON_BASH_TRAP_FUNCTIONS, cluster_info::KubernetesClusterInfo,
39+
crds::raw_object_list_schema,
4040
},
4141
};
4242
use stackable_versioned::versioned;
@@ -46,7 +46,7 @@ use crate::crd::{
4646
affinity::get_affinity,
4747
authorization::DruidAuthorization,
4848
resource::RoleResource,
49-
tls::{default_druid_tls, DruidTls},
49+
tls::{DruidTls, default_druid_tls},
5050
};
5151

5252
pub mod affinity;

0 commit comments

Comments
 (0)