Skip to content

Commit 0030bfb

Browse files
committed
merge main
2 parents 90efe2b + 8d3c69e commit 0030bfb

File tree

16 files changed

+107
-94
lines changed

16 files changed

+107
-94
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: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ use stackable_operator::{
2626
merge::{Atomic, Merge},
2727
},
2828
k8s_openapi::{
29+
DeepMerge,
2930
api::core::v1::{EnvVar, Pod, PodTemplateSpec},
3031
apimachinery::pkg::api::resource::Quantity,
31-
DeepMerge,
3232
},
33-
kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt},
33+
kube::{CustomResource, ResourceExt, runtime::reflector::ObjectRef},
3434
product_config_utils::Configuration,
3535
product_logging::{self, spec::Logging},
3636
role_utils::{GenericRoleConfig, JavaCommonConfig, Role, RoleGroupRef},
@@ -817,15 +817,14 @@ pub enum HbaseRole {
817817

818818
impl HbaseRole {
819819
const DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minutes_unchecked(20);
820-
const DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration =
821-
Duration::from_minutes_unchecked(60);
822-
const DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration =
823-
Duration::from_minutes_unchecked(5);
824-
825820
// Auto TLS certificate lifetime
826821
const DEFAULT_MASTER_SECRET_LIFETIME: Duration = Duration::from_days_unchecked(1);
827822
const DEFAULT_REGION_SECRET_LIFETIME: Duration = Duration::from_days_unchecked(1);
823+
const DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration =
824+
Duration::from_minutes_unchecked(60);
828825
const DEFAULT_REST_SECRET_LIFETIME: Duration = Duration::from_days_unchecked(1);
826+
const DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration =
827+
Duration::from_minutes_unchecked(5);
829828

830829
pub fn default_config(
831830
&self,
@@ -1369,34 +1368,39 @@ impl AnyServiceConfig {
13691368
AnyServiceConfig::RestServer(config) => &config.resources,
13701369
}
13711370
}
1371+
13721372
pub fn logging(&self) -> &Logging<Container> {
13731373
match self {
13741374
AnyServiceConfig::Master(config) => &config.logging,
13751375
AnyServiceConfig::RegionServer(config) => &config.logging,
13761376
AnyServiceConfig::RestServer(config) => &config.logging,
13771377
}
13781378
}
1379+
13791380
pub fn affinity(&self) -> &StackableAffinity {
13801381
match self {
13811382
AnyServiceConfig::Master(config) => &config.affinity,
13821383
AnyServiceConfig::RegionServer(config) => &config.affinity,
13831384
AnyServiceConfig::RestServer(config) => &config.affinity,
13841385
}
13851386
}
1387+
13861388
pub fn graceful_shutdown_timeout(&self) -> &Option<Duration> {
13871389
match self {
13881390
AnyServiceConfig::Master(config) => &config.graceful_shutdown_timeout,
13891391
AnyServiceConfig::RegionServer(config) => &config.graceful_shutdown_timeout,
13901392
AnyServiceConfig::RestServer(config) => &config.graceful_shutdown_timeout,
13911393
}
13921394
}
1395+
13931396
pub fn requested_secret_lifetime(&self) -> Option<Duration> {
13941397
match self {
13951398
AnyServiceConfig::Master(config) => config.requested_secret_lifetime,
13961399
AnyServiceConfig::RegionServer(config) => config.requested_secret_lifetime,
13971400
AnyServiceConfig::RestServer(config) => config.requested_secret_lifetime,
13981401
}
13991402
}
1403+
14001404
pub fn listener_class(&self) -> SupportedListenerClasses {
14011405
match self {
14021406
AnyServiceConfig::Master(config) => config.listener_class.clone(),
@@ -1466,7 +1470,7 @@ mod tests {
14661470
use std::collections::{BTreeMap, HashMap};
14671471

14681472
use indoc::indoc;
1469-
use product_config::{types::PropertyNameKind, ProductConfigManager};
1473+
use product_config::{ProductConfigManager, types::PropertyNameKind};
14701474
use rstest::rstest;
14711475
use stackable_operator::product_config_utils::{
14721476
transform_all_roles_to_config, validate_all_roles_and_groups_config,

rust/operator-binary/src/discovery.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ use stackable_operator::{
66
builder::{configmap::ConfigMapBuilder, meta::ObjectMetaBuilder},
77
commons::product_image_selection::ResolvedProductImage,
88
k8s_openapi::api::core::v1::ConfigMap,
9-
kube::{runtime::reflector::ObjectRef, ResourceExt},
9+
kube::{ResourceExt, runtime::reflector::ObjectRef},
1010
utils::cluster_info::KubernetesClusterInfo,
1111
};
1212

1313
use crate::{
14-
crd::{v1alpha1, HbasePodRef, HbaseRole, HBASE_SITE_XML},
14+
crd::{HBASE_SITE_XML, HbasePodRef, 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
@@ -10,9 +10,9 @@ use std::{
1010
use const_format::concatcp;
1111
use indoc::formatdoc;
1212
use product_config::{
13-
types::PropertyNameKind,
14-
writer::{to_hadoop_xml, to_java_properties_string, PropertiesWriterError},
1513
ProductConfigManager,
14+
types::PropertyNameKind,
15+
writer::{PropertiesWriterError, to_hadoop_xml, to_java_properties_string},
1616
};
1717
use snafu::{OptionExt, ResultExt, Snafu};
1818
use stackable_operator::{
@@ -21,14 +21,14 @@ use stackable_operator::{
2121
configmap::ConfigMapBuilder,
2222
meta::ObjectMetaBuilder,
2323
pod::{
24+
PodBuilder,
2425
container::ContainerBuilder,
2526
resources::ResourceRequirementsBuilder,
2627
security::PodSecurityContextBuilder,
2728
volume::{
2829
ListenerOperatorVolumeSourceBuilder, ListenerOperatorVolumeSourceBuilderError,
2930
ListenerReference,
3031
},
31-
PodBuilder,
3232
},
3333
},
3434
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
@@ -44,9 +44,9 @@ use stackable_operator::{
4444
apimachinery::pkg::{apis::meta::v1::LabelSelector, util::intstr::IntOrString},
4545
},
4646
kube::{
47-
core::{error_boundary, DeserializeGuard},
48-
runtime::controller::Action,
4947
Resource, ResourceExt,
48+
core::{DeserializeGuard, error_boundary},
49+
runtime::controller::Action,
5050
},
5151
kvp::{Label, LabelError, Labels, ObjectLabels},
5252
logging::controller::ReconcilerError,
@@ -71,15 +71,16 @@ use stackable_operator::{
7171
use strum::{EnumDiscriminants, IntoStaticStr, ParseError};
7272

7373
use crate::{
74+
OPERATOR_NAME,
7475
config::jvm::{
7576
construct_global_jvm_args, construct_hbase_heapsize_env,
7677
construct_role_specific_non_heap_jvm_args,
7778
},
7879
crd::{
79-
merged_env, v1alpha1, AnyServiceConfig, Container, HbaseClusterStatus, HbasePodRef,
80-
HbaseRole, APP_NAME, HBASE_ENV_SH, HBASE_REST_PORT_NAME_HTTP, HBASE_REST_PORT_NAME_HTTPS,
81-
HBASE_SITE_XML, JVM_SECURITY_PROPERTIES_FILE, LISTENER_VOLUME_DIR, LISTENER_VOLUME_NAME,
82-
SSL_CLIENT_XML, SSL_SERVER_XML,
80+
APP_NAME, AnyServiceConfig, Container, HBASE_ENV_SH, HBASE_REST_PORT_NAME_HTTP,
81+
HBASE_REST_PORT_NAME_HTTPS, HBASE_SITE_XML, HbaseClusterStatus, HbasePodRef, HbaseRole,
82+
JVM_SECURITY_PROPERTIES_FILE, LISTENER_VOLUME_DIR, LISTENER_VOLUME_NAME, SSL_CLIENT_XML,
83+
SSL_SERVER_XML, merged_env, v1alpha1,
8384
},
8485
discovery::{build_discovery_configmap, build_endpoint_configmap},
8586
kerberos::{
@@ -88,12 +89,11 @@ use crate::{
8889
},
8990
operations::{graceful_shutdown::add_graceful_shutdown_config, pdb::add_pdbs},
9091
product_logging::{
91-
extend_role_group_config_map, resolve_vector_aggregator_address,
92-
CONTAINERDEBUG_LOG_DIRECTORY, STACKABLE_LOG_DIR,
92+
CONTAINERDEBUG_LOG_DIRECTORY, STACKABLE_LOG_DIR, extend_role_group_config_map,
93+
resolve_vector_aggregator_address,
9394
},
9495
security::{self, opa::HbaseOpaConfig},
9596
zookeeper::{self, ZookeeperConnectionInformation},
96-
OPERATOR_NAME,
9797
};
9898

9999
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)