Skip to content

Commit 48c4349

Browse files
chore: Update templated files (f1f1a9e) (#663)
* 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 2262af4. * Revert "ci: use nightly toolchain for cargo udeps" This reverts commit 3b057eb. --------- Co-authored-by: Nick Larsen <nick.larsen@stackable.tech>
1 parent 0bf659d commit 48c4349

File tree

19 files changed

+231
-230
lines changed

19 files changed

+231
-230
lines changed

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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 6 additions & 3 deletions
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

Lines changed: 7 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use stackable_operator::{
66
};
77

88
use crate::{
9-
crd::{constants::JVM_SECURITY_PROPERTIES_FILE, v1alpha1, HdfsNodeRole},
9+
crd::{HdfsNodeRole, constants::JVM_SECURITY_PROPERTIES_FILE, v1alpha1},
1010
security::kerberos::KERBEROS_CONTAINER_PATH,
1111
};
1212

@@ -186,7 +186,8 @@ mod tests {
186186
-Dhttps.proxyHost=proxy.my.corp \
187187
-Djava.net.preferIPv4Stack=true \
188188
-Xmx40000m \
189-
-Dhttps.proxyPort=1234")
189+
-Dhttps.proxyPort=1234"
190+
)
190191
);
191192
}
192193

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ use product_config::writer::to_hadoop_xml;
44
use stackable_operator::utils::cluster_info::KubernetesClusterInfo;
55

66
use crate::crd::{
7+
HdfsPodRef,
78
constants::{
8-
DEFAULT_JOURNAL_NODE_RPC_PORT, DEFAULT_NAME_NODE_HTTPS_PORT, DEFAULT_NAME_NODE_HTTP_PORT,
9+
DEFAULT_JOURNAL_NODE_RPC_PORT, DEFAULT_NAME_NODE_HTTP_PORT, DEFAULT_NAME_NODE_HTTPS_PORT,
910
DEFAULT_NAME_NODE_RPC_PORT, DFS_DATANODE_DATA_DIR, DFS_HA_NAMENODES,
10-
DFS_JOURNALNODE_EDITS_DIR, DFS_JOURNALNODE_RPC_ADDRESS, DFS_NAMENODE_HTTPS_ADDRESS,
11-
DFS_NAMENODE_HTTP_ADDRESS, DFS_NAMENODE_NAME_DIR, DFS_NAMENODE_RPC_ADDRESS,
12-
DFS_NAMENODE_SHARED_EDITS_DIR, DFS_NAME_SERVICES, DFS_REPLICATION, FS_DEFAULT_FS,
11+
DFS_JOURNALNODE_EDITS_DIR, DFS_JOURNALNODE_RPC_ADDRESS, DFS_NAME_SERVICES,
12+
DFS_NAMENODE_HTTP_ADDRESS, DFS_NAMENODE_HTTPS_ADDRESS, DFS_NAMENODE_NAME_DIR,
13+
DFS_NAMENODE_RPC_ADDRESS, DFS_NAMENODE_SHARED_EDITS_DIR, DFS_REPLICATION, FS_DEFAULT_FS,
1314
HA_ZOOKEEPER_QUORUM, JOURNALNODE_ROOT_DATA_DIR, NAMENODE_ROOT_DATA_DIR,
1415
SERVICE_PORT_NAME_HTTP, SERVICE_PORT_NAME_HTTPS, SERVICE_PORT_NAME_RPC,
1516
},
1617
storage::{DataNodeStorageConfig, DataNodeStorageConfigInnerType},
17-
v1alpha1, HdfsPodRef,
18+
v1alpha1,
1819
};
1920

2021
pub mod jvm;

rust/operator-binary/src/container.rs

Lines changed: 47 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ use stackable_operator::{
1717
builder::{
1818
self,
1919
pod::{
20+
PodBuilder,
2021
container::ContainerBuilder,
2122
resources::ResourceRequirementsBuilder,
2223
volume::{
2324
ListenerOperatorVolumeSourceBuilder, ListenerOperatorVolumeSourceBuilderError,
2425
ListenerReference, SecretFormat, SecretOperatorVolumeSourceBuilder,
2526
SecretOperatorVolumeSourceBuilderError, VolumeBuilder, VolumeMountBuilder,
2627
},
27-
PodBuilder,
2828
},
2929
},
3030
commons::product_image_selection::ResolvedProductImage,
@@ -36,19 +36,19 @@ use stackable_operator::{
3636
},
3737
apimachinery::pkg::util::intstr::IntOrString,
3838
},
39-
kube::{core::ObjectMeta, ResourceExt},
39+
kube::{ResourceExt, core::ObjectMeta},
4040
kvp::Labels,
4141
product_logging::{
4242
self,
4343
framework::{
44-
create_vector_shutdown_file_command, remove_vector_shutdown_file_command, LoggingError,
44+
LoggingError, create_vector_shutdown_file_command, remove_vector_shutdown_file_command,
4545
},
4646
spec::{
4747
ConfigMapLogConfig, ContainerLogConfig, ContainerLogConfigChoice,
4848
CustomContainerLogConfig,
4949
},
5050
},
51-
utils::{cluster_info::KubernetesClusterInfo, COMMON_BASH_TRAP_FUNCTIONS},
51+
utils::{COMMON_BASH_TRAP_FUNCTIONS, cluster_info::KubernetesClusterInfo},
5252
};
5353
use strum::{Display, EnumDiscriminants, IntoStaticStr};
5454

@@ -58,6 +58,8 @@ use crate::{
5858
jvm::{construct_global_jvm_args, construct_role_specific_jvm_args},
5959
},
6060
crd::{
61+
AnyNodeConfig, DataNodeContainer, HdfsNodeRole, HdfsPodRef, NameNodeContainer,
62+
UpgradeState,
6163
constants::{
6264
DATANODE_ROOT_DATA_DIR_PREFIX, DEFAULT_DATA_NODE_METRICS_PORT,
6365
DEFAULT_JOURNAL_NODE_METRICS_PORT, DEFAULT_NAME_NODE_METRICS_PORT, LISTENER_VOLUME_DIR,
@@ -69,8 +71,7 @@ use crate::{
6971
SERVICE_PORT_NAME_RPC, STACKABLE_ROOT_DATA_DIR,
7072
},
7173
storage::DataNodeStorageConfig,
72-
v1alpha1, AnyNodeConfig, DataNodeContainer, HdfsNodeRole, HdfsPodRef, NameNodeContainer,
73-
UpgradeState,
74+
v1alpha1,
7475
},
7576
product_logging::{
7677
FORMAT_NAMENODES_LOG4J_CONFIG_FILE, FORMAT_ZOOKEEPER_LOG4J_CONFIG_FILE,
@@ -104,10 +105,9 @@ pub enum Error {
104105
role: String,
105106
},
106107

107-
#[snafu(
108-
display("could not determine any ContainerConfig actions for {container_name:?}. Container not recognized."
109-
)
110-
)]
108+
#[snafu(display(
109+
"could not determine any ContainerConfig actions for {container_name:?}. Container not recognized."
110+
))]
111111
UnrecognizedContainerName { container_name: String },
112112

113113
#[snafu(display("invalid container name {name:?}"))]
@@ -191,22 +191,20 @@ pub enum ContainerConfig {
191191
}
192192

193193
impl ContainerConfig {
194-
// volumes
195-
pub const STACKABLE_LOG_VOLUME_MOUNT_NAME: &'static str = "log";
196194
pub const DATA_VOLUME_MOUNT_NAME: &'static str = "data";
197-
pub const HDFS_CONFIG_VOLUME_MOUNT_NAME: &'static str = "hdfs-config";
198-
199-
const HDFS_LOG_VOLUME_MOUNT_NAME: &'static str = "hdfs-log-config";
200-
const ZKFC_CONFIG_VOLUME_MOUNT_NAME: &'static str = "zkfc-config";
201-
const ZKFC_LOG_VOLUME_MOUNT_NAME: &'static str = "zkfc-log-config";
202195
const FORMAT_NAMENODES_CONFIG_VOLUME_MOUNT_NAME: &'static str = "format-namenodes-config";
203196
const FORMAT_NAMENODES_LOG_VOLUME_MOUNT_NAME: &'static str = "format-namenodes-log-config";
204197
const FORMAT_ZOOKEEPER_CONFIG_VOLUME_MOUNT_NAME: &'static str = "format-zookeeper-config";
205198
const FORMAT_ZOOKEEPER_LOG_VOLUME_MOUNT_NAME: &'static str = "format-zookeeper-log-config";
199+
const HADOOP_HOME: &'static str = "/stackable/hadoop";
200+
pub const HDFS_CONFIG_VOLUME_MOUNT_NAME: &'static str = "hdfs-config";
201+
const HDFS_LOG_VOLUME_MOUNT_NAME: &'static str = "hdfs-log-config";
202+
// volumes
203+
pub const STACKABLE_LOG_VOLUME_MOUNT_NAME: &'static str = "log";
206204
const WAIT_FOR_NAMENODES_CONFIG_VOLUME_MOUNT_NAME: &'static str = "wait-for-namenodes-config";
207205
const WAIT_FOR_NAMENODES_LOG_VOLUME_MOUNT_NAME: &'static str = "wait-for-namenodes-log-config";
208-
209-
const HADOOP_HOME: &'static str = "/stackable/hadoop";
206+
const ZKFC_CONFIG_VOLUME_MOUNT_NAME: &'static str = "zkfc-config";
207+
const ZKFC_LOG_VOLUME_MOUNT_NAME: &'static str = "zkfc-log-config";
210208

211209
/// Add all main, side and init containers as well as required volumes to the pod builder.
212210
#[allow(clippy::too_many_arguments)]
@@ -802,7 +800,9 @@ wait_for_termination $!
802800

803801
// Command to export `KERBEROS_REALM` env var to default real from krb5.conf, e.g. `CLUSTER.LOCAL`
804802
fn export_kerberos_real_env_var_command() -> String {
805-
format!("export KERBEROS_REALM=$(grep -oP 'default_realm = \\K.*' {KERBEROS_CONTAINER_PATH}/krb5.conf)\n")
803+
format!(
804+
"export KERBEROS_REALM=$(grep -oP 'default_realm = \\K.*' {KERBEROS_CONTAINER_PATH}/krb5.conf)\n"
805+
)
806806
}
807807

808808
/// Command to `kinit` a ticket using the principal created for the specified hdfs role
@@ -869,52 +869,37 @@ wait_for_termination $!
869869
// See https://github.com/stackabletech/hdfs-operator/issues/138 for details
870870
if let ContainerConfig::Hdfs { role, .. } = self {
871871
let role_opts_name = role.hadoop_opts_env_var_for_role().to_string();
872-
env.insert(
873-
role_opts_name.clone(),
874-
EnvVar {
875-
name: role_opts_name,
876-
value: Some(self.build_hadoop_opts(hdfs, role_group, resources)?),
877-
..EnvVar::default()
878-
},
879-
);
872+
env.insert(role_opts_name.clone(), EnvVar {
873+
name: role_opts_name,
874+
value: Some(self.build_hadoop_opts(hdfs, role_group, resources)?),
875+
..EnvVar::default()
876+
});
880877
}
881878

882-
env.insert(
883-
"HADOOP_OPTS".to_string(),
884-
EnvVar {
885-
name: "HADOOP_OPTS".to_string(),
886-
value: Some(construct_global_jvm_args(hdfs.has_kerberos_enabled())),
887-
..EnvVar::default()
888-
},
889-
);
879+
env.insert("HADOOP_OPTS".to_string(), EnvVar {
880+
name: "HADOOP_OPTS".to_string(),
881+
value: Some(construct_global_jvm_args(hdfs.has_kerberos_enabled())),
882+
..EnvVar::default()
883+
});
890884
if hdfs.has_kerberos_enabled() {
891-
env.insert(
892-
"KRB5_CONFIG".to_string(),
893-
EnvVar {
894-
name: "KRB5_CONFIG".to_string(),
895-
value: Some(format!("{KERBEROS_CONTAINER_PATH}/krb5.conf")),
896-
..EnvVar::default()
897-
},
898-
);
899-
env.insert(
900-
"KRB5_CLIENT_KTNAME".to_string(),
901-
EnvVar {
902-
name: "KRB5_CLIENT_KTNAME".to_string(),
903-
value: Some(format!("{KERBEROS_CONTAINER_PATH}/keytab")),
904-
..EnvVar::default()
905-
},
906-
);
885+
env.insert("KRB5_CONFIG".to_string(), EnvVar {
886+
name: "KRB5_CONFIG".to_string(),
887+
value: Some(format!("{KERBEROS_CONTAINER_PATH}/krb5.conf")),
888+
..EnvVar::default()
889+
});
890+
env.insert("KRB5_CLIENT_KTNAME".to_string(), EnvVar {
891+
name: "KRB5_CLIENT_KTNAME".to_string(),
892+
value: Some(format!("{KERBEROS_CONTAINER_PATH}/keytab")),
893+
..EnvVar::default()
894+
});
907895
}
908896

909897
// Needed for the `containerdebug` process to log it's tracing information to.
910-
env.insert(
911-
"CONTAINERDEBUG_LOG_DIRECTORY".to_string(),
912-
EnvVar {
913-
name: "CONTAINERDEBUG_LOG_DIRECTORY".to_string(),
914-
value: Some(format!("{STACKABLE_LOG_DIR}/containerdebug")),
915-
value_from: None,
916-
},
917-
);
898+
env.insert("CONTAINERDEBUG_LOG_DIRECTORY".to_string(), EnvVar {
899+
name: "CONTAINERDEBUG_LOG_DIRECTORY".to_string(),
900+
value: Some(format!("{STACKABLE_LOG_DIR}/containerdebug")),
901+
value_from: None,
902+
});
918903

919904
// Overrides need to come last
920905
let mut env_override_vars: BTreeMap<String, EnvVar> =
@@ -1457,13 +1442,15 @@ impl ContainerVolumeDirs {
14571442
pub fn config_mount(&self) -> &str {
14581443
self.config_mount.as_str()
14591444
}
1445+
14601446
pub fn config_mount_name(&self) -> &str {
14611447
self.config_mount_name.as_str()
14621448
}
14631449

14641450
pub fn log_mount(&self) -> &str {
14651451
self.log_mount.as_str()
14661452
}
1453+
14671454
pub fn log_mount_name(&self) -> &str {
14681455
self.log_mount_name.as_str()
14691456
}

0 commit comments

Comments
 (0)