Skip to content

Commit 44656fb

Browse files
committed
chore: Merge remote-tracking branch 'origin/main' into feat/stackable-telemetry
2 parents c264ac6 + 4185691 commit 44656fb

File tree

17 files changed

+97
-82
lines changed

17 files changed

+97
-82
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/config/jvm.rs

+14-8
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use stackable_operator::{
55
};
66

77
use crate::crd::{
8-
v1alpha1::{ZookeeperCluster, ZookeeperConfig, ZookeeperConfigFragment},
9-
LoggingFramework, JVM_SECURITY_PROPERTIES_FILE, LOG4J_CONFIG_FILE, LOGBACK_CONFIG_FILE,
8+
JVM_SECURITY_PROPERTIES_FILE, LOG4J_CONFIG_FILE, LOGBACK_CONFIG_FILE, LoggingFramework,
109
METRICS_PORT, STACKABLE_CONFIG_DIR, STACKABLE_LOG_CONFIG_DIR,
10+
v1alpha1::{ZookeeperCluster, ZookeeperConfig, ZookeeperConfigFragment},
1111
};
1212

1313
const JAVA_HEAP_FACTOR: f32 = 0.8;
@@ -35,11 +35,17 @@ fn construct_jvm_args(
3535
let logging_framework = zk.logging_framework();
3636

3737
let jvm_args = vec![
38-
format!("-Djava.security.properties={STACKABLE_CONFIG_DIR}/{JVM_SECURITY_PROPERTIES_FILE}"),
39-
format!("-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar={METRICS_PORT}:/stackable/jmx/server.yaml"),
40-
match logging_framework {
41-
LoggingFramework::LOG4J => format!("-Dlog4j.configuration=file:{STACKABLE_LOG_CONFIG_DIR}/{LOG4J_CONFIG_FILE}"),
42-
LoggingFramework::LOGBACK => format!("-Dlogback.configurationFile={STACKABLE_LOG_CONFIG_DIR}/{LOGBACK_CONFIG_FILE}"),
38+
format!("-Djava.security.properties={STACKABLE_CONFIG_DIR}/{JVM_SECURITY_PROPERTIES_FILE}"),
39+
format!(
40+
"-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar={METRICS_PORT}:/stackable/jmx/server.yaml"
41+
),
42+
match logging_framework {
43+
LoggingFramework::LOG4J => {
44+
format!("-Dlog4j.configuration=file:{STACKABLE_LOG_CONFIG_DIR}/{LOG4J_CONFIG_FILE}")
45+
}
46+
LoggingFramework::LOGBACK => format!(
47+
"-Dlogback.configurationFile={STACKABLE_LOG_CONFIG_DIR}/{LOGBACK_CONFIG_FILE}"
48+
),
4349
},
4450
];
4551

@@ -93,7 +99,7 @@ fn is_heap_jvm_argument(jvm_argument: &str) -> bool {
9399
#[cfg(test)]
94100
mod tests {
95101
use super::*;
96-
use crate::crd::{v1alpha1::ZookeeperConfig, ZookeeperRole};
102+
use crate::crd::{ZookeeperRole, v1alpha1::ZookeeperConfig};
97103

98104
#[test]
99105
fn test_construct_jvm_arguments_defaults() {

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

+2-2
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::PodAntiAffinity,
44
};
55

6-
use crate::crd::{ZookeeperRole, APP_NAME};
6+
use crate::crd::{APP_NAME, ZookeeperRole};
77

88
pub fn get_affinity(cluster_name: &str, role: &ZookeeperRole) -> StackableAffinityFragment {
99
let affinity_between_role_pods =

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ pub enum Error {
1919
authentication_class: ObjectRef<AuthenticationClass>,
2020
},
2121
// TODO: Adapt message if multiple authentication classes are supported
22-
#[snafu(display("only one authentication class is currently supported. Possible Authentication classes are {SUPPORTED_AUTHENTICATION_CLASS:?}"))]
22+
#[snafu(display(
23+
"only one authentication class is currently supported. Possible Authentication classes are {SUPPORTED_AUTHENTICATION_CLASS:?}"
24+
))]
2325
MultipleAuthenticationClassesProvided,
2426
#[snafu(display(
2527
"failed to use authentication method [{method}] for authentication class [{authentication_class}] - supported mechanisms: {SUPPORTED_AUTHENTICATION_CLASS:?}",
@@ -81,7 +83,7 @@ impl ResolvedAuthenticationClasses {
8183
return Err(Error::AuthenticationMethodNotSupported {
8284
authentication_class: ObjectRef::from_obj(auth_class),
8385
method: auth_class.spec.provider.to_string(),
84-
})
86+
});
8587
}
8688
}
8789
}

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

+4-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use stackable_operator::{
2121
api::core::v1::{PersistentVolumeClaim, ResourceRequirements},
2222
apimachinery::pkg::api::resource::Quantity,
2323
},
24-
kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt},
24+
kube::{CustomResource, ResourceExt, runtime::reflector::ObjectRef},
2525
memory::{BinaryMultiple, MemoryQuantity},
2626
product_config_utils::{self, Configuration},
2727
product_logging::{self, spec::Logging},
@@ -368,14 +368,12 @@ impl v1alpha1::CurrentlySupportedListenerClasses {
368368
}
369369

370370
impl v1alpha1::ZookeeperConfig {
371+
pub const DATA_DIR: &'static str = "dataDir";
372+
const DEFAULT_SECRET_LIFETIME: Duration = Duration::from_days_unchecked(1);
371373
pub const INIT_LIMIT: &'static str = "initLimit";
374+
pub const MYID_OFFSET: &'static str = "MYID_OFFSET";
372375
pub const SYNC_LIMIT: &'static str = "syncLimit";
373376
pub const TICK_TIME: &'static str = "tickTime";
374-
pub const DATA_DIR: &'static str = "dataDir";
375-
376-
pub const MYID_OFFSET: &'static str = "MYID_OFFSET";
377-
378-
const DEFAULT_SECRET_LIFETIME: Duration = Duration::from_days_unchecked(1);
379377

380378
fn default_server_config(
381379
cluster_name: &str,

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

+12-12
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ use stackable_operator::{
1111
builder::{
1212
self,
1313
pod::{
14+
PodBuilder,
1415
container::ContainerBuilder,
1516
volume::{
1617
SecretFormat, SecretOperatorVolumeSourceBuilder,
1718
SecretOperatorVolumeSourceBuilderError, VolumeBuilder,
1819
},
19-
PodBuilder,
2020
},
2121
},
2222
client::Client,
@@ -60,14 +60,21 @@ impl ZookeeperSecurity {
6060
// ports
6161
pub const CLIENT_PORT: u16 = 2181;
6262
pub const CLIENT_PORT_NAME: &'static str = "clientPort";
63-
pub const SECURE_CLIENT_PORT: u16 = 2282;
64-
pub const SECURE_CLIENT_PORT_NAME: &'static str = "secureClientPort";
6563
// directories
6664
pub const QUORUM_TLS_DIR: &'static str = "/stackable/quorum_tls";
6765
pub const QUORUM_TLS_MOUNT_DIR: &'static str = "/stackable/quorum_tls_mount";
66+
pub const SECURE_CLIENT_PORT: u16 = 2282;
67+
pub const SECURE_CLIENT_PORT_NAME: &'static str = "secureClientPort";
68+
pub const SERVER_CNXN_FACTORY: &'static str = "serverCnxnFactory";
6869
pub const SERVER_TLS_DIR: &'static str = "/stackable/server_tls";
6970
pub const SERVER_TLS_MOUNT_DIR: &'static str = "/stackable/server_tls_mount";
70-
pub const SYSTEM_TRUST_STORE_DIR: &'static str = "/etc/pki/java/cacerts";
71+
// Common TLS
72+
pub const SSL_AUTH_PROVIDER_X509: &'static str = "authProvider.x509";
73+
// Client TLS
74+
pub const SSL_CLIENT_AUTH: &'static str = "ssl.clientAuth";
75+
pub const SSL_HOST_NAME_VERIFICATION: &'static str = "ssl.hostnameVerification";
76+
pub const SSL_KEY_STORE_LOCATION: &'static str = "ssl.keyStore.location";
77+
pub const SSL_KEY_STORE_PASSWORD: &'static str = "ssl.keyStore.password";
7178
// Quorum TLS
7279
pub const SSL_QUORUM: &'static str = "sslQuorum";
7380
pub const SSL_QUORUM_CLIENT_AUTH: &'static str = "ssl.quorum.clientAuth";
@@ -76,18 +83,11 @@ impl ZookeeperSecurity {
7683
pub const SSL_QUORUM_KEY_STORE_PASSWORD: &'static str = "ssl.quorum.keyStore.password";
7784
pub const SSL_QUORUM_TRUST_STORE_LOCATION: &'static str = "ssl.quorum.trustStore.location";
7885
pub const SSL_QUORUM_TRUST_STORE_PASSWORD: &'static str = "ssl.quorum.trustStore.password";
79-
// Client TLS
80-
pub const SSL_CLIENT_AUTH: &'static str = "ssl.clientAuth";
81-
pub const SSL_HOST_NAME_VERIFICATION: &'static str = "ssl.hostnameVerification";
82-
pub const SSL_KEY_STORE_LOCATION: &'static str = "ssl.keyStore.location";
83-
pub const SSL_KEY_STORE_PASSWORD: &'static str = "ssl.keyStore.password";
8486
pub const SSL_TRUST_STORE_LOCATION: &'static str = "ssl.trustStore.location";
8587
pub const SSL_TRUST_STORE_PASSWORD: &'static str = "ssl.trustStore.password";
86-
// Common TLS
87-
pub const SSL_AUTH_PROVIDER_X509: &'static str = "authProvider.x509";
88-
pub const SERVER_CNXN_FACTORY: &'static str = "serverCnxnFactory";
8988
// Mis
9089
pub const STORE_PASSWORD_ENV: &'static str = "STORE_PASSWORD";
90+
pub const SYSTEM_TRUST_STORE_DIR: &'static str = "/etc/pki/java/cacerts";
9191

9292
/// Create a `ZookeeperSecurity` struct from the Zookeeper custom resource and resolve
9393
/// all provided `AuthenticationClass` references.

rust/operator-binary/src/discovery.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ use stackable_operator::{
55
builder::{configmap::ConfigMapBuilder, meta::ObjectMetaBuilder},
66
commons::product_image_selection::ResolvedProductImage,
77
k8s_openapi::api::core::v1::{ConfigMap, Endpoints, Service},
8-
kube::{runtime::reflector::ObjectRef, Resource, ResourceExt},
8+
kube::{Resource, ResourceExt, runtime::reflector::ObjectRef},
99
utils::cluster_info::KubernetesClusterInfo,
1010
};
1111

1212
use crate::{
13-
crd::{security::ZookeeperSecurity, v1alpha1, ZookeeperRole},
13+
crd::{ZookeeperRole, security::ZookeeperSecurity, v1alpha1},
1414
utils::build_recommended_labels,
1515
};
1616

rust/operator-binary/src/main.rs

+14-19
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
use std::sync::Arc;
22

33
use clap::Parser;
4-
use crd::{v1alpha1, ZookeeperCluster, ZookeeperZnode, APP_NAME, OPERATOR_NAME};
5-
use futures::{pin_mut, StreamExt};
4+
use crd::{APP_NAME, OPERATOR_NAME, ZookeeperCluster, ZookeeperZnode, v1alpha1};
5+
use futures::{StreamExt, pin_mut};
66
use stackable_operator::{
7+
YamlSchema,
78
cli::{Command, ProductOperatorRun},
89
k8s_openapi::api::{
910
apps::v1::StatefulSet,
1011
core::v1::{ConfigMap, Endpoints, Service},
1112
},
1213
kube::{
14+
Resource,
1315
core::DeserializeGuard,
1416
runtime::{
17+
Controller,
1518
events::{Recorder, Reporter},
1619
reflector::ObjectRef,
17-
watcher, Controller,
20+
watcher,
1821
},
19-
Resource,
2022
},
2123
logging::controller::report_controller_reconciled,
2224
shared::yaml::SerializeOptions,
23-
YamlSchema,
2425
};
2526

2627
use crate::{zk_controller::ZK_FULL_CONTROLLER_NAME, znode_controller::ZNODE_FULL_CONTROLLER_NAME};
@@ -92,13 +93,10 @@ async fn main() -> anyhow::Result<()> {
9293
watcher::Config::default(),
9394
);
9495

95-
let zk_event_recorder = Arc::new(Recorder::new(
96-
client.as_kube_client(),
97-
Reporter {
98-
controller: ZK_FULL_CONTROLLER_NAME.to_string(),
99-
instance: None,
100-
},
101-
));
96+
let zk_event_recorder = Arc::new(Recorder::new(client.as_kube_client(), Reporter {
97+
controller: ZK_FULL_CONTROLLER_NAME.to_string(),
98+
instance: None,
99+
}));
102100
let zk_store = zk_controller.store();
103101
let zk_controller = zk_controller
104102
.owns(
@@ -162,13 +160,10 @@ async fn main() -> anyhow::Result<()> {
162160
watch_namespace.get_api::<DeserializeGuard<v1alpha1::ZookeeperZnode>>(&client),
163161
watcher::Config::default(),
164162
);
165-
let znode_event_recorder = Arc::new(Recorder::new(
166-
client.as_kube_client(),
167-
Reporter {
168-
controller: ZNODE_FULL_CONTROLLER_NAME.to_string(),
169-
instance: None,
170-
},
171-
));
163+
let znode_event_recorder = Arc::new(Recorder::new(client.as_kube_client(), Reporter {
164+
controller: ZNODE_FULL_CONTROLLER_NAME.to_string(),
165+
instance: None,
166+
}));
172167

173168
let znode_store = znode_controller.store();
174169
let znode_controller = znode_controller

rust/operator-binary/src/operations/pdb.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use stackable_operator::{
55
};
66

77
use crate::{
8-
crd::{v1alpha1, ZookeeperRole, APP_NAME, OPERATOR_NAME},
8+
crd::{APP_NAME, OPERATOR_NAME, ZookeeperRole, v1alpha1},
99
zk_controller::ZK_CONTROLLER_NAME,
1010
};
1111

rust/operator-binary/src/product_logging.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use stackable_operator::{
1313
};
1414

1515
use crate::crd::{
16-
v1alpha1, LoggingFramework, ZookeeperRole, LOG4J_CONFIG_FILE, LOGBACK_CONFIG_FILE,
17-
MAX_ZK_LOG_FILES_SIZE, STACKABLE_LOG_DIR, ZOOKEEPER_LOG_FILE,
16+
LOG4J_CONFIG_FILE, LOGBACK_CONFIG_FILE, LoggingFramework, MAX_ZK_LOG_FILES_SIZE,
17+
STACKABLE_LOG_DIR, ZOOKEEPER_LOG_FILE, ZookeeperRole, v1alpha1,
1818
};
1919

2020
#[derive(Snafu, Debug)]

0 commit comments

Comments
 (0)