Skip to content

Commit 8d3c69e

Browse files
chore: Update templated files (f1f1a9e) (#643)
* 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 1921472. * Revert "ci: use nightly toolchain for cargo udeps" This reverts commit 02c63ec. --------- Co-authored-by: Nick Larsen <nick.larsen@stackable.tech>
1 parent be97330 commit 8d3c69e

File tree

16 files changed

+105
-93
lines changed

16 files changed

+105
-93
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use stackable_operator::{
55
};
66

77
use crate::crd::{
8-
v1alpha1, AnyServiceConfig, HbaseRole, CONFIG_DIR_NAME, JVM_SECURITY_PROPERTIES_FILE,
9-
METRICS_PORT,
8+
AnyServiceConfig, CONFIG_DIR_NAME, HbaseRole, JVM_SECURITY_PROPERTIES_FILE, METRICS_PORT,
9+
v1alpha1,
1010
};
1111

1212
const JAVA_HEAP_FACTOR: f32 = 0.8;
@@ -144,7 +144,7 @@ fn is_heap_jvm_argument(jvm_argument: &str) -> bool {
144144
#[cfg(test)]
145145
mod tests {
146146
use super::*;
147-
use crate::crd::{v1alpha1, HbaseRole};
147+
use crate::crd::{HbaseRole, v1alpha1};
148148

149149
#[test]
150150
fn test_construct_jvm_arguments_defaults() {

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

Lines changed: 36 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use stackable_operator::{
22
commons::affinity::{
3-
affinity_between_cluster_pods, affinity_between_role_pods, StackableAffinityFragment,
3+
StackableAffinityFragment, affinity_between_cluster_pods, affinity_between_role_pods,
44
},
55
k8s_openapi::api::core::v1::{PodAffinity, PodAntiAffinity},
66
};
77

8-
use crate::crd::{HbaseRole, APP_NAME};
8+
use crate::crd::{APP_NAME, HbaseRole};
99

1010
pub fn get_affinity(
1111
cluster_name: &str,
@@ -186,45 +186,39 @@ mod tests {
186186
HbaseRole::RestServer => (),
187187
};
188188

189-
assert_eq!(
190-
affinity,
191-
StackableAffinity {
192-
pod_affinity: Some(PodAffinity {
193-
preferred_during_scheduling_ignored_during_execution: Some(expected_affinities),
194-
required_during_scheduling_ignored_during_execution: None,
195-
}),
196-
pod_anti_affinity: Some(PodAntiAffinity {
197-
preferred_during_scheduling_ignored_during_execution: Some(vec![
198-
WeightedPodAffinityTerm {
199-
pod_affinity_term: PodAffinityTerm {
200-
label_selector: Some(LabelSelector {
201-
match_expressions: None,
202-
match_labels: Some(BTreeMap::from([
203-
("app.kubernetes.io/name".to_string(), "hbase".to_string(),),
204-
(
205-
"app.kubernetes.io/instance".to_string(),
206-
"simple-hbase".to_string(),
207-
),
208-
(
209-
"app.kubernetes.io/component".to_string(),
210-
role.to_string(),
211-
)
212-
]))
213-
}),
214-
match_label_keys: None,
215-
mismatch_label_keys: None,
216-
namespace_selector: None,
217-
namespaces: None,
218-
topology_key: "kubernetes.io/hostname".to_string(),
219-
},
220-
weight: 70
221-
}
222-
]),
223-
required_during_scheduling_ignored_during_execution: None,
224-
}),
225-
node_affinity: None,
226-
node_selector: None,
227-
}
228-
);
189+
assert_eq!(affinity, StackableAffinity {
190+
pod_affinity: Some(PodAffinity {
191+
preferred_during_scheduling_ignored_during_execution: Some(expected_affinities),
192+
required_during_scheduling_ignored_during_execution: None,
193+
}),
194+
pod_anti_affinity: Some(PodAntiAffinity {
195+
preferred_during_scheduling_ignored_during_execution: Some(vec![
196+
WeightedPodAffinityTerm {
197+
pod_affinity_term: PodAffinityTerm {
198+
label_selector: Some(LabelSelector {
199+
match_expressions: None,
200+
match_labels: Some(BTreeMap::from([
201+
("app.kubernetes.io/name".to_string(), "hbase".to_string(),),
202+
(
203+
"app.kubernetes.io/instance".to_string(),
204+
"simple-hbase".to_string(),
205+
),
206+
("app.kubernetes.io/component".to_string(), role.to_string(),)
207+
]))
208+
}),
209+
match_label_keys: None,
210+
mismatch_label_keys: None,
211+
namespace_selector: None,
212+
namespaces: None,
213+
topology_key: "kubernetes.io/hostname".to_string(),
214+
},
215+
weight: 70
216+
}
217+
]),
218+
required_during_scheduling_ignored_during_execution: None,
219+
}),
220+
node_affinity: None,
221+
node_selector: None,
222+
});
229223
}
230224
}

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ use stackable_operator::{
2020
merge::{Atomic, Merge},
2121
},
2222
k8s_openapi::{
23+
DeepMerge,
2324
api::core::v1::{EnvVar, PodTemplateSpec},
2425
apimachinery::pkg::api::resource::Quantity,
25-
DeepMerge,
2626
},
27-
kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt},
27+
kube::{CustomResource, ResourceExt, runtime::reflector::ObjectRef},
2828
product_config_utils::Configuration,
2929
product_logging::{self, spec::Logging},
3030
role_utils::{GenericRoleConfig, JavaCommonConfig, Role, RoleGroupRef},
@@ -640,15 +640,14 @@ pub enum HbaseRole {
640640

641641
impl HbaseRole {
642642
const DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minutes_unchecked(20);
643-
const DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration =
644-
Duration::from_minutes_unchecked(60);
645-
const DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration =
646-
Duration::from_minutes_unchecked(5);
647-
648643
// Auto TLS certificate lifetime
649644
const DEFAULT_MASTER_SECRET_LIFETIME: Duration = Duration::from_days_unchecked(1);
650645
const DEFAULT_REGION_SECRET_LIFETIME: Duration = Duration::from_days_unchecked(1);
646+
const DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration =
647+
Duration::from_minutes_unchecked(60);
651648
const DEFAULT_REST_SECRET_LIFETIME: Duration = Duration::from_days_unchecked(1);
649+
const DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration =
650+
Duration::from_minutes_unchecked(5);
652651

653652
pub fn default_config(
654653
&self,
@@ -1153,27 +1152,31 @@ impl AnyServiceConfig {
11531152
AnyServiceConfig::RestServer(config) => &config.resources,
11541153
}
11551154
}
1155+
11561156
pub fn logging(&self) -> &Logging<Container> {
11571157
match self {
11581158
AnyServiceConfig::Master(config) => &config.logging,
11591159
AnyServiceConfig::RegionServer(config) => &config.logging,
11601160
AnyServiceConfig::RestServer(config) => &config.logging,
11611161
}
11621162
}
1163+
11631164
pub fn affinity(&self) -> &StackableAffinity {
11641165
match self {
11651166
AnyServiceConfig::Master(config) => &config.affinity,
11661167
AnyServiceConfig::RegionServer(config) => &config.affinity,
11671168
AnyServiceConfig::RestServer(config) => &config.affinity,
11681169
}
11691170
}
1171+
11701172
pub fn graceful_shutdown_timeout(&self) -> &Option<Duration> {
11711173
match self {
11721174
AnyServiceConfig::Master(config) => &config.graceful_shutdown_timeout,
11731175
AnyServiceConfig::RegionServer(config) => &config.graceful_shutdown_timeout,
11741176
AnyServiceConfig::RestServer(config) => &config.graceful_shutdown_timeout,
11751177
}
11761178
}
1179+
11771180
pub fn requested_secret_lifetime(&self) -> Option<Duration> {
11781181
match self {
11791182
AnyServiceConfig::Master(config) => config.requested_secret_lifetime,
@@ -1243,7 +1246,7 @@ mod tests {
12431246
use std::collections::{BTreeMap, HashMap};
12441247

12451248
use indoc::indoc;
1246-
use product_config::{types::PropertyNameKind, ProductConfigManager};
1249+
use product_config::{ProductConfigManager, types::PropertyNameKind};
12471250
use rstest::rstest;
12481251
use stackable_operator::product_config_utils::{
12491252
transform_all_roles_to_config, validate_all_roles_and_groups_config,

rust/operator-binary/src/discovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use stackable_operator::{
1111
};
1212

1313
use crate::{
14-
crd::{v1alpha1, HbaseRole, HBASE_SITE_XML},
14+
crd::{HBASE_SITE_XML, HbaseRole, v1alpha1},
1515
hbase_controller::build_recommended_labels,
1616
kerberos::{self, kerberos_discovery_config_properties},
1717
zookeeper::ZookeeperConnectionInformation,

rust/operator-binary/src/hbase_controller.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use std::{
99

1010
use const_format::concatcp;
1111
use product_config::{
12-
types::PropertyNameKind,
13-
writer::{to_hadoop_xml, to_java_properties_string, PropertiesWriterError},
1412
ProductConfigManager,
13+
types::PropertyNameKind,
14+
writer::{PropertiesWriterError, to_hadoop_xml, to_java_properties_string},
1515
};
1616
use snafu::{OptionExt, ResultExt, Snafu};
1717
use stackable_operator::{
@@ -20,8 +20,8 @@ use stackable_operator::{
2020
configmap::ConfigMapBuilder,
2121
meta::ObjectMetaBuilder,
2222
pod::{
23-
container::ContainerBuilder, resources::ResourceRequirementsBuilder,
24-
security::PodSecurityContextBuilder, PodBuilder,
23+
PodBuilder, container::ContainerBuilder, resources::ResourceRequirementsBuilder,
24+
security::PodSecurityContextBuilder,
2525
},
2626
},
2727
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
@@ -37,9 +37,9 @@ use stackable_operator::{
3737
apimachinery::pkg::{apis::meta::v1::LabelSelector, util::intstr::IntOrString},
3838
},
3939
kube::{
40-
core::{error_boundary, DeserializeGuard},
41-
runtime::controller::Action,
4240
Resource, ResourceExt,
41+
core::{DeserializeGuard, error_boundary},
42+
runtime::controller::Action,
4343
},
4444
kvp::{Label, LabelError, Labels, ObjectLabels},
4545
logging::controller::ReconcilerError,
@@ -64,14 +64,15 @@ use stackable_operator::{
6464
use strum::{EnumDiscriminants, IntoStaticStr, ParseError};
6565

6666
use crate::{
67+
OPERATOR_NAME,
6768
config::jvm::{
6869
construct_global_jvm_args, construct_hbase_heapsize_env,
6970
construct_role_specific_non_heap_jvm_args,
7071
},
7172
crd::{
72-
merged_env, v1alpha1, AnyServiceConfig, Container, HbaseClusterStatus, HbaseRole, APP_NAME,
73-
HBASE_ENV_SH, HBASE_REST_PORT_NAME_HTTP, HBASE_REST_PORT_NAME_HTTPS, HBASE_SITE_XML,
74-
JVM_SECURITY_PROPERTIES_FILE, SSL_CLIENT_XML, SSL_SERVER_XML,
73+
APP_NAME, AnyServiceConfig, Container, HBASE_ENV_SH, HBASE_REST_PORT_NAME_HTTP,
74+
HBASE_REST_PORT_NAME_HTTPS, HBASE_SITE_XML, HbaseClusterStatus, HbaseRole,
75+
JVM_SECURITY_PROPERTIES_FILE, SSL_CLIENT_XML, SSL_SERVER_XML, merged_env, v1alpha1,
7576
},
7677
discovery::build_discovery_configmap,
7778
kerberos::{
@@ -80,12 +81,11 @@ use crate::{
8081
},
8182
operations::{graceful_shutdown::add_graceful_shutdown_config, pdb::add_pdbs},
8283
product_logging::{
83-
extend_role_group_config_map, resolve_vector_aggregator_address,
84-
CONTAINERDEBUG_LOG_DIRECTORY, STACKABLE_LOG_DIR,
84+
CONTAINERDEBUG_LOG_DIRECTORY, STACKABLE_LOG_DIR, extend_role_group_config_map,
85+
resolve_vector_aggregator_address,
8586
},
8687
security::{self, opa::HbaseOpaConfig},
8788
zookeeper::{self, ZookeeperConnectionInformation},
88-
OPERATOR_NAME,
8989
};
9090

9191
pub const HBASE_CONTROLLER_NAME: &str = "hbasecluster";

rust/operator-binary/src/kerberos.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ use stackable_operator::{
55
builder::{
66
self,
77
pod::{
8+
PodBuilder,
89
container::ContainerBuilder,
910
volume::{SecretFormat, SecretOperatorVolumeSourceBuilder, VolumeBuilder},
10-
PodBuilder,
1111
},
1212
},
13-
kube::{runtime::reflector::ObjectRef, ResourceExt},
13+
kube::{ResourceExt, runtime::reflector::ObjectRef},
1414
time::Duration,
1515
utils::cluster_info::KubernetesClusterInfo,
1616
};
1717

18-
use crate::crd::{v1alpha1, TLS_STORE_DIR, TLS_STORE_PASSWORD, TLS_STORE_VOLUME_NAME};
18+
use crate::crd::{TLS_STORE_DIR, TLS_STORE_PASSWORD, TLS_STORE_VOLUME_NAME, v1alpha1};
1919

2020
#[derive(Snafu, Debug)]
2121
pub enum Error {

0 commit comments

Comments
 (0)