Skip to content

Commit 8f6f999

Browse files
chore: Update templated files (f1f1a9e) (#587)
* 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 3bcc002. * Revert "ci: use nightly toolchain for cargo udeps" This reverts commit 57ab56a. --------- Co-authored-by: Nick Larsen <nick.larsen@stackable.tech>
1 parent 7fa21a9 commit 8f6f999

File tree

15 files changed

+117
-96
lines changed

15 files changed

+117
-96
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/command.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use stackable_operator::commons::s3::S3ConnectionSpec;
22

33
use crate::crd::{
4-
v1alpha1, DB_PASSWORD_ENV, DB_PASSWORD_PLACEHOLDER, DB_USERNAME_ENV, DB_USERNAME_PLACEHOLDER,
4+
DB_PASSWORD_ENV, DB_PASSWORD_PLACEHOLDER, DB_USERNAME_ENV, DB_USERNAME_PLACEHOLDER,
55
HIVE_METASTORE_LOG4J2_PROPERTIES, HIVE_SITE_XML, STACKABLE_CONFIG_DIR,
66
STACKABLE_CONFIG_MOUNT_DIR, STACKABLE_LOG_CONFIG_MOUNT_DIR, STACKABLE_TRUST_STORE,
7-
STACKABLE_TRUST_STORE_PASSWORD, SYSTEM_TRUST_STORE, SYSTEM_TRUST_STORE_PASSWORD,
7+
STACKABLE_TRUST_STORE_PASSWORD, SYSTEM_TRUST_STORE, SYSTEM_TRUST_STORE_PASSWORD, v1alpha1,
88
};
99

1010
pub fn build_container_command_args(
@@ -16,17 +16,24 @@ pub fn build_container_command_args(
1616
// copy config files to a writeable empty folder in order to set s3 access and secret keys
1717
format!("echo copying {STACKABLE_CONFIG_MOUNT_DIR} to {STACKABLE_CONFIG_DIR}"),
1818
format!("cp -RL {STACKABLE_CONFIG_MOUNT_DIR}/* {STACKABLE_CONFIG_DIR}"),
19-
2019
// Copy log4j2 properties
21-
format!("echo copying {STACKABLE_LOG_CONFIG_MOUNT_DIR}/{HIVE_METASTORE_LOG4J2_PROPERTIES} to {STACKABLE_CONFIG_DIR}/{HIVE_METASTORE_LOG4J2_PROPERTIES}"),
22-
format!("cp -RL {STACKABLE_LOG_CONFIG_MOUNT_DIR}/{HIVE_METASTORE_LOG4J2_PROPERTIES} {STACKABLE_CONFIG_DIR}/{HIVE_METASTORE_LOG4J2_PROPERTIES}"),
23-
20+
format!(
21+
"echo copying {STACKABLE_LOG_CONFIG_MOUNT_DIR}/{HIVE_METASTORE_LOG4J2_PROPERTIES} to {STACKABLE_CONFIG_DIR}/{HIVE_METASTORE_LOG4J2_PROPERTIES}"
22+
),
23+
format!(
24+
"cp -RL {STACKABLE_LOG_CONFIG_MOUNT_DIR}/{HIVE_METASTORE_LOG4J2_PROPERTIES} {STACKABLE_CONFIG_DIR}/{HIVE_METASTORE_LOG4J2_PROPERTIES}"
25+
),
2426
// Template config files
25-
format!("if test -f {STACKABLE_CONFIG_DIR}/core-site.xml; then config-utils template {STACKABLE_CONFIG_DIR}/core-site.xml; fi"),
26-
format!("if test -f {STACKABLE_CONFIG_DIR}/hive-site.xml; then config-utils template {STACKABLE_CONFIG_DIR}/hive-site.xml; fi"),
27-
27+
format!(
28+
"if test -f {STACKABLE_CONFIG_DIR}/core-site.xml; then config-utils template {STACKABLE_CONFIG_DIR}/core-site.xml; fi"
29+
),
30+
format!(
31+
"if test -f {STACKABLE_CONFIG_DIR}/hive-site.xml; then config-utils template {STACKABLE_CONFIG_DIR}/hive-site.xml; fi"
32+
),
2833
// Copy system truststore to stackable truststore
29-
format!("keytool -importkeystore -srckeystore {SYSTEM_TRUST_STORE} -srcstoretype jks -srcstorepass {SYSTEM_TRUST_STORE_PASSWORD} -destkeystore {STACKABLE_TRUST_STORE} -deststoretype pkcs12 -deststorepass {STACKABLE_TRUST_STORE_PASSWORD} -noprompt")
34+
format!(
35+
"keytool -importkeystore -srckeystore {SYSTEM_TRUST_STORE} -srcstoretype jks -srcstorepass {SYSTEM_TRUST_STORE_PASSWORD} -destkeystore {STACKABLE_TRUST_STORE} -deststoretype pkcs12 -deststorepass {STACKABLE_TRUST_STORE_PASSWORD} -noprompt"
36+
),
3037
];
3138

3239
if hive.spec.cluster_config.hdfs.is_some() {

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ use stackable_operator::{
55
};
66

77
use crate::crd::{
8-
v1alpha1::HiveCluster, MetaStoreConfig, MetaStoreConfigFragment, JVM_SECURITY_PROPERTIES_FILE,
9-
METRICS_PORT, STACKABLE_CONFIG_DIR, STACKABLE_TRUST_STORE, STACKABLE_TRUST_STORE_PASSWORD,
8+
JVM_SECURITY_PROPERTIES_FILE, METRICS_PORT, MetaStoreConfig, MetaStoreConfigFragment,
9+
STACKABLE_CONFIG_DIR, STACKABLE_TRUST_STORE, STACKABLE_TRUST_STORE_PASSWORD,
10+
v1alpha1::HiveCluster,
1011
};
1112

1213
const JAVA_HEAP_FACTOR: f32 = 0.8;
@@ -33,7 +34,9 @@ fn construct_jvm_args(
3334
) -> Result<Vec<String>, Error> {
3435
let mut jvm_args = vec![
3536
format!("-Djava.security.properties={STACKABLE_CONFIG_DIR}/{JVM_SECURITY_PROPERTIES_FILE}"),
36-
format!("-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar={METRICS_PORT}:/stackable/jmx/jmx_hive_config.yaml"),
37+
format!(
38+
"-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar={METRICS_PORT}:/stackable/jmx/jmx_hive_config.yaml"
39+
),
3740
format!("-Djavax.net.ssl.trustStore={STACKABLE_TRUST_STORE}"),
3841
format!("-Djavax.net.ssl.trustStorePassword={STACKABLE_TRUST_STORE_PASSWORD}"),
3942
format!("-Djavax.net.ssl.trustStoreType=pkcs12"),

rust/operator-binary/src/controller.rs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ use const_format::concatcp;
1111
use fnv::FnvHasher;
1212
use indoc::formatdoc;
1313
use product_config::{
14-
types::PropertyNameKind,
15-
writer::{to_hadoop_xml, to_java_properties_string, PropertiesWriterError},
1614
ProductConfigManager,
15+
types::PropertyNameKind,
16+
writer::{PropertiesWriterError, to_hadoop_xml, to_java_properties_string},
1717
};
1818
use snafu::{OptionExt, ResultExt, Snafu};
1919
use stackable_operator::{
@@ -22,8 +22,8 @@ use stackable_operator::{
2222
configmap::ConfigMapBuilder,
2323
meta::ObjectMetaBuilder,
2424
pod::{
25-
container::ContainerBuilder, resources::ResourceRequirementsBuilder,
26-
security::PodSecurityContextBuilder, volume::VolumeBuilder, PodBuilder,
25+
PodBuilder, container::ContainerBuilder, resources::ResourceRequirementsBuilder,
26+
security::PodSecurityContextBuilder, volume::VolumeBuilder,
2727
},
2828
},
2929
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
@@ -34,6 +34,7 @@ use stackable_operator::{
3434
tls_verification::TlsClientDetailsError,
3535
},
3636
k8s_openapi::{
37+
DeepMerge,
3738
api::{
3839
apps::v1::{StatefulSet, StatefulSetSpec},
3940
core::v1::{
@@ -44,12 +45,11 @@ use stackable_operator::{
4445
apimachinery::pkg::{
4546
api::resource::Quantity, apis::meta::v1::LabelSelector, util::intstr::IntOrString,
4647
},
47-
DeepMerge,
4848
},
4949
kube::{
50-
core::{error_boundary, DeserializeGuard},
51-
runtime::controller::Action,
5250
Resource, ResourceExt,
51+
core::{DeserializeGuard, error_boundary},
52+
runtime::controller::Action,
5353
},
5454
kvp::{Label, Labels, ObjectLabels},
5555
logging::controller::ReconcilerError,
@@ -58,7 +58,7 @@ use stackable_operator::{
5858
product_logging::{
5959
self,
6060
framework::{
61-
create_vector_shutdown_file_command, remove_vector_shutdown_file_command, LoggingError,
61+
LoggingError, create_vector_shutdown_file_command, remove_vector_shutdown_file_command,
6262
},
6363
spec::{
6464
ConfigMapLogConfig, ContainerLogConfig, ContainerLogConfigChoice,
@@ -71,21 +71,22 @@ use stackable_operator::{
7171
statefulset::StatefulSetConditionBuilder,
7272
},
7373
time::Duration,
74-
utils::{cluster_info::KubernetesClusterInfo, COMMON_BASH_TRAP_FUNCTIONS},
74+
utils::{COMMON_BASH_TRAP_FUNCTIONS, cluster_info::KubernetesClusterInfo},
7575
};
7676
use strum::EnumDiscriminants;
7777
use tracing::warn;
7878

7979
use crate::{
80+
OPERATOR_NAME,
8081
command::build_container_command_args,
8182
config::jvm::{construct_hadoop_heapsize_env, construct_non_heap_jvm_args},
8283
crd::{
83-
v1alpha1, Container, HiveClusterStatus, HiveRole, MetaStoreConfig, APP_NAME, CORE_SITE_XML,
84-
DB_PASSWORD_ENV, DB_USERNAME_ENV, HIVE_PORT, HIVE_PORT_NAME, HIVE_SITE_XML,
85-
JVM_SECURITY_PROPERTIES_FILE, METRICS_PORT, METRICS_PORT_NAME, STACKABLE_CONFIG_DIR,
84+
APP_NAME, CORE_SITE_XML, Container, DB_PASSWORD_ENV, DB_USERNAME_ENV, HIVE_PORT,
85+
HIVE_PORT_NAME, HIVE_SITE_XML, HiveClusterStatus, HiveRole, JVM_SECURITY_PROPERTIES_FILE,
86+
METRICS_PORT, METRICS_PORT_NAME, MetaStoreConfig, STACKABLE_CONFIG_DIR,
8687
STACKABLE_CONFIG_DIR_NAME, STACKABLE_CONFIG_MOUNT_DIR, STACKABLE_CONFIG_MOUNT_DIR_NAME,
8788
STACKABLE_LOG_CONFIG_MOUNT_DIR, STACKABLE_LOG_CONFIG_MOUNT_DIR_NAME, STACKABLE_LOG_DIR,
88-
STACKABLE_LOG_DIR_NAME,
89+
STACKABLE_LOG_DIR_NAME, v1alpha1,
8990
},
9091
discovery,
9192
kerberos::{
@@ -94,7 +95,6 @@ use crate::{
9495
},
9596
operations::{graceful_shutdown::add_graceful_shutdown_config, pdb::add_pdbs},
9697
product_logging::{extend_role_group_config_map, resolve_vector_aggregator_address},
97-
OPERATOR_NAME,
9898
};
9999

100100
pub const HIVE_CONTROLLER_NAME: &str = "hivecluster";
@@ -872,7 +872,9 @@ fn build_metastore_rolegroup_statefulset(
872872
//
873873
// TODO: Once we drop support for HMS 3.1.x we can remove this condition and very likely get rid of the
874874
// "bin/start-metastore" script.
875-
format!("bin/start-metastore --config {STACKABLE_CONFIG_DIR} --db-type {db_type} --hive-bin-dir bin &")
875+
format!(
876+
"bin/start-metastore --config {STACKABLE_CONFIG_DIR} --db-type {db_type} --hive-bin-dir bin &"
877+
)
876878
} else {
877879
// schematool versions 4.0.x (and above) support the `-initOrUpgradeSchema`, which is exactly what we need :)
878880
// Some docs for the schemaTool can be found here: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=34835119

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

Lines changed: 33 additions & 36 deletions
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::{HiveRole, APP_NAME};
6+
use crate::crd::{APP_NAME, HiveRole};
77

88
pub fn get_affinity(cluster_name: &str, role: &HiveRole) -> StackableAffinityFragment {
99
StackableAffinityFragment {
@@ -61,39 +61,36 @@ mod tests {
6161
.merged_config(&role, &role.rolegroup_ref(&hive, "default"))
6262
.unwrap();
6363

64-
assert_eq!(
65-
merged_config.affinity,
66-
StackableAffinity {
67-
pod_affinity: None,
68-
pod_anti_affinity: Some(PodAntiAffinity {
69-
preferred_during_scheduling_ignored_during_execution: Some(vec![
70-
WeightedPodAffinityTerm {
71-
pod_affinity_term: PodAffinityTerm {
72-
label_selector: Some(LabelSelector {
73-
match_labels: Some(BTreeMap::from([
74-
("app.kubernetes.io/name".to_string(), "hive".to_string(),),
75-
(
76-
"app.kubernetes.io/instance".to_string(),
77-
"simple-hive".to_string(),
78-
),
79-
(
80-
"app.kubernetes.io/component".to_string(),
81-
"metastore".to_string(),
82-
)
83-
])),
84-
..LabelSelector::default()
85-
}),
86-
topology_key: "kubernetes.io/hostname".to_string(),
87-
..PodAffinityTerm::default()
88-
},
89-
weight: 70
90-
}
91-
]),
92-
required_during_scheduling_ignored_during_execution: None,
93-
}),
94-
node_affinity: None,
95-
node_selector: None,
96-
}
97-
);
64+
assert_eq!(merged_config.affinity, StackableAffinity {
65+
pod_affinity: None,
66+
pod_anti_affinity: Some(PodAntiAffinity {
67+
preferred_during_scheduling_ignored_during_execution: Some(vec![
68+
WeightedPodAffinityTerm {
69+
pod_affinity_term: PodAffinityTerm {
70+
label_selector: Some(LabelSelector {
71+
match_labels: Some(BTreeMap::from([
72+
("app.kubernetes.io/name".to_string(), "hive".to_string(),),
73+
(
74+
"app.kubernetes.io/instance".to_string(),
75+
"simple-hive".to_string(),
76+
),
77+
(
78+
"app.kubernetes.io/component".to_string(),
79+
"metastore".to_string(),
80+
)
81+
])),
82+
..LabelSelector::default()
83+
}),
84+
topology_key: "kubernetes.io/hostname".to_string(),
85+
..PodAffinityTerm::default()
86+
},
87+
weight: 70
88+
}
89+
]),
90+
required_during_scheduling_ignored_during_execution: None,
91+
}),
92+
node_affinity: None,
93+
node_selector: None,
94+
});
9895
}
9996
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use stackable_operator::{
1919
merge::Merge,
2020
},
2121
k8s_openapi::apimachinery::pkg::api::resource::Quantity,
22-
kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt},
22+
kube::{CustomResource, ResourceExt, runtime::reflector::ObjectRef},
2323
product_config_utils::{self, Configuration},
2424
product_logging::{self, spec::Logging},
2525
role_utils::{GenericRoleConfig, JavaCommonConfig, Role, RoleGroup, RoleGroupRef},
@@ -451,20 +451,20 @@ pub struct MetaStoreConfig {
451451
}
452452

453453
impl MetaStoreConfig {
454+
pub const CONNECTION_DRIVER_NAME: &'static str = "javax.jdo.option.ConnectionDriverName";
455+
pub const CONNECTION_PASSWORD: &'static str = "javax.jdo.option.ConnectionPassword";
454456
// metastore
455457
pub const CONNECTION_URL: &'static str = "javax.jdo.option.ConnectionURL";
456-
pub const CONNECTION_DRIVER_NAME: &'static str = "javax.jdo.option.ConnectionDriverName";
457458
pub const CONNECTION_USER_NAME: &'static str = "javax.jdo.option.ConnectionUserName";
458-
pub const CONNECTION_PASSWORD: &'static str = "javax.jdo.option.ConnectionPassword";
459459
pub const METASTORE_METRICS_ENABLED: &'static str = "hive.metastore.metrics.enabled";
460460
pub const METASTORE_WAREHOUSE_DIR: &'static str = "hive.metastore.warehouse.dir";
461+
pub const S3_ACCESS_KEY: &'static str = "fs.s3a.access.key";
461462
// S3
462463
pub const S3_ENDPOINT: &'static str = "fs.s3a.endpoint";
464+
pub const S3_PATH_STYLE_ACCESS: &'static str = "fs.s3a.path.style.access";
463465
pub const S3_REGION_NAME: &'static str = "fs.s3a.endpoint.region";
464-
pub const S3_ACCESS_KEY: &'static str = "fs.s3a.access.key";
465466
pub const S3_SECRET_KEY: &'static str = "fs.s3a.secret.key";
466467
pub const S3_SSL_ENABLED: &'static str = "fs.s3a.connection.ssl.enabled";
467-
pub const S3_PATH_STYLE_ACCESS: &'static str = "fs.s3a.path.style.access";
468468

469469
fn default_config(cluster_name: &str, role: &HiveRole) -> MetaStoreConfigFragment {
470470
MetaStoreConfigFragment {

rust/operator-binary/src/discovery.rs

Lines changed: 2 additions & 2 deletions
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, ServiceSpec},
8-
kube::{runtime::reflector::ObjectRef, Resource},
8+
kube::{Resource, runtime::reflector::ObjectRef},
99
};
1010

1111
use crate::{
1212
controller::build_recommended_labels,
13-
crd::{v1alpha1, HiveRole, ServiceType, HIVE_PORT, HIVE_PORT_NAME},
13+
crd::{HIVE_PORT, HIVE_PORT_NAME, HiveRole, ServiceType, v1alpha1},
1414
};
1515

1616
#[derive(Snafu, Debug)]

rust/operator-binary/src/kerberos.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ use stackable_operator::{
66
builder::{
77
self,
88
pod::{
9+
PodBuilder,
910
container::ContainerBuilder,
1011
volume::{
1112
SecretOperatorVolumeSourceBuilder, SecretOperatorVolumeSourceBuilderError,
1213
VolumeBuilder,
1314
},
14-
PodBuilder,
1515
},
1616
},
1717
kube::ResourceExt,
1818
utils::cluster_info::KubernetesClusterInfo,
1919
};
2020

21-
use crate::crd::{v1alpha1, HiveRole, HIVE_SITE_XML, STACKABLE_CONFIG_DIR};
21+
use crate::crd::{HIVE_SITE_XML, HiveRole, STACKABLE_CONFIG_DIR, v1alpha1};
2222

2323
#[derive(Snafu, Debug)]
2424
#[allow(clippy::enum_variant_names)] // all variants have the same prefix: `Add`

0 commit comments

Comments
 (0)