Skip to content

Commit 033d5a0

Browse files
authored
chore: Update to stackable-operator 0.95.0 (#710)
1 parent f7a9f71 commit 033d5a0

File tree

9 files changed

+1641
-1281
lines changed

9 files changed

+1641
-1281
lines changed

Cargo.lock

Lines changed: 447 additions & 438 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 1159 additions & 820 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ repository = "https://github.com/stackabletech/hdfs-operator"
1111

1212
[workspace.dependencies]
1313
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
14-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.94.0" }
14+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.95.0" }
1515

1616
anyhow = "1.0"
1717
built = { version = "0.8", features = ["chrono", "git2"] }
1818
clap = "4.5"
1919
const_format = "0.2"
2020
futures = { version = "0.3", features = ["compat"] }
2121
indoc = "2.0"
22-
rstest = "0.25"
22+
rstest = "0.26"
2323
semver = "1.0"
2424
serde = { version = "1.0", features = ["derive"] }
2525
serde_json = "1.0"

crate-hashes.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use stackable_operator::time::Duration;
1+
use stackable_operator::shared::time::Duration;
22

33
pub const DEFAULT_DFS_REPLICATION_FACTOR: u8 = 3;
44

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ use stackable_operator::{
4141
RoleGroupRef,
4242
},
4343
schemars::{self, JsonSchema},
44+
shared::time::Duration,
4445
status::condition::{ClusterCondition, HasStatusCondition},
45-
time::Duration,
4646
utils::cluster_info::KubernetesClusterInfo,
4747
versioned::versioned,
4848
};

rust/operator-binary/src/discovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn build_discovery_configmap(
6161
.with_recommended_labels(build_recommended_labels(
6262
hdfs,
6363
controller,
64-
&resolved_product_image.app_version_label,
64+
&resolved_product_image.app_version_label_value,
6565
&HdfsNodeRole::Name.to_string(),
6666
"discovery",
6767
))

rust/operator-binary/src/hdfs_controller.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ use stackable_operator::{
1818
},
1919
client::Client,
2020
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
21-
commons::{product_image_selection::ResolvedProductImage, rbac::build_rbac_resources},
21+
commons::{
22+
product_image_selection::{self, ResolvedProductImage},
23+
rbac::build_rbac_resources,
24+
},
2225
iter::reverse_if,
2326
k8s_openapi::{
2427
DeepMerge,
@@ -38,14 +41,14 @@ use stackable_operator::{
3841
logging::controller::ReconcilerError,
3942
product_config_utils::{transform_all_roles_to_config, validate_all_roles_and_groups_config},
4043
role_utils::{GenericRoleConfig, RoleGroupRef},
44+
shared::time::Duration,
4145
status::{
4246
condition::{
4347
compute_conditions, operations::ClusterOperationsConditionBuilder,
4448
statefulset::StatefulSetConditionBuilder,
4549
},
4650
rollout::check_statefulset_rollout_complete,
4751
},
48-
time::Duration,
4952
utils::cluster_info::KubernetesClusterInfo,
5053
};
5154
use strum::{EnumDiscriminants, IntoEnumIterator, IntoStaticStr};
@@ -242,6 +245,11 @@ pub enum Error {
242245
InvalidHdfsCluster {
243246
source: error_boundary::InvalidObject,
244247
},
248+
249+
#[snafu(display("failed to resolve product image"))]
250+
ResolveProductImage {
251+
source: product_image_selection::Error,
252+
},
245253
}
246254

247255
impl ReconcilerError for Error {
@@ -274,7 +282,8 @@ pub async fn reconcile_hdfs(
274282
let resolved_product_image = hdfs
275283
.spec
276284
.image
277-
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
285+
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
286+
.context(ResolveProductImageSnafu)?;
278287

279288
let validated_config = validate_all_roles_and_groups_config(
280289
&resolved_product_image.product_version,
@@ -396,7 +405,7 @@ pub async fn reconcile_hdfs(
396405
.with_recommended_labels(build_recommended_labels(
397406
hdfs,
398407
RESOURCE_MANAGER_HDFS_CONTROLLER,
399-
&resolved_product_image.app_version_label,
408+
&resolved_product_image.app_version_label_value,
400409
&rolegroup_ref.role,
401410
&rolegroup_ref.role_group,
402411
))
@@ -1007,7 +1016,11 @@ properties: []
10071016
let env_overrides = rolegroup_config.get(&PropertyNameKind::Env);
10081017

10091018
let merged_config = role.merged_config(&hdfs, "default").unwrap();
1010-
let resolved_product_image = hdfs.spec.image.resolve(DOCKER_IMAGE_BASE_NAME, "0.0.0-dev");
1019+
let resolved_product_image = hdfs
1020+
.spec
1021+
.image
1022+
.resolve(DOCKER_IMAGE_BASE_NAME, "0.0.0-dev")
1023+
.expect("test resolved product image is always valid");
10111024

10121025
let mut pb = PodBuilder::new();
10131026
pb.metadata(ObjectMeta::default());

rust/operator-binary/src/main.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ async fn main() -> anyhow::Result<()> {
7070
Command::Run(ProductOperatorRun {
7171
product_config,
7272
watch_namespace,
73-
telemetry_arguments,
74-
cluster_info_opts,
73+
operator_environment: _,
74+
telemetry,
75+
cluster_info,
7576
}) => {
7677
// NOTE (@NickLarsenNZ): Before stackable-telemetry was used:
7778
// - The console log level was set by `HDFS_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
7879
// - The file log level was set by `HDFS_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
7980
// - The file log directory was set by `HDFS_OPERATOR_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR` (or via `--rolling-logs <DIRECTORY>`).
80-
let _tracing_guard =
81-
Tracing::pre_configured(built_info::PKG_NAME, telemetry_arguments).init()?;
81+
let _tracing_guard = Tracing::pre_configured(built_info::PKG_NAME, telemetry).init()?;
8282

8383
tracing::info!(
8484
built_info.pkg_version = built_info::PKG_VERSION,
@@ -95,8 +95,7 @@ async fn main() -> anyhow::Result<()> {
9595
"/etc/stackable/hdfs-operator/config-spec/properties.yaml",
9696
])?;
9797
let client =
98-
client::initialize_operator(Some(OPERATOR_NAME.to_string()), &cluster_info_opts)
99-
.await?;
98+
client::initialize_operator(Some(OPERATOR_NAME.to_string()), &cluster_info).await?;
10099
create_controller(client, product_config, watch_namespace).await;
101100
}
102101
};

0 commit comments

Comments
 (0)