Skip to content

Commit bedb3d8

Browse files
authored
chore: Update to stackable-operator 0.95.0 (#750)
1 parent f4d7eb9 commit bedb3d8

File tree

10 files changed

+1203
-551
lines changed

10 files changed

+1203
-551
lines changed

Cargo.lock

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

Cargo.nix

Lines changed: 858 additions & 328 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,7 +11,7 @@ repository = "https://github.com/stackabletech/druid-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"] }
@@ -22,7 +22,7 @@ futures = { version = "0.3", features = ["compat"] }
2222
indoc = "2.0"
2323
openssl = "0.10"
2424
pin-project = "1.1"
25-
rstest = "0.25"
25+
rstest = "0.26"
2626
semver = "1.0"
2727
serde = { version = "1.0", features = ["derive"] }
2828
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/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ use stackable_operator::{
3030
},
3131
role_utils::{CommonConfiguration, GenericRoleConfig, JavaCommonConfig, Role, RoleGroup},
3232
schemars::{self, JsonSchema},
33+
shared::time::Duration,
3334
status::condition::{ClusterCondition, HasStatusCondition},
34-
time::Duration,
3535
utils::{COMMON_BASH_TRAP_FUNCTIONS, crds::raw_object_list_schema},
3636
versioned::versioned,
3737
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use stackable_operator::{
1818
api::core::v1::{ContainerPort, Probe, ServicePort, TCPSocketAction},
1919
apimachinery::pkg::util::intstr::IntOrString,
2020
},
21-
time::Duration,
21+
shared::time::Duration,
2222
};
2323

2424
use crate::crd::{

rust/operator-binary/src/discovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ fn build_discovery_configmap(
9393
.with_recommended_labels(build_recommended_labels(
9494
druid,
9595
DRUID_CONTROLLER_NAME,
96-
&resolved_product_image.app_version_label,
96+
&resolved_product_image.app_version_label_value,
9797
&DruidRole::Router.to_string(),
9898
"discovery",
9999
))

rust/operator-binary/src/druid_controller.rs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ use stackable_operator::{
2626
},
2727
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
2828
commons::{
29-
opa::OpaApiVersion, product_image_selection::ResolvedProductImage,
30-
rbac::build_rbac_resources, tls_verification::TlsClientDetailsError,
29+
opa::OpaApiVersion,
30+
product_image_selection::{self, ResolvedProductImage},
31+
rbac::build_rbac_resources,
32+
tls_verification::TlsClientDetailsError,
3133
},
3234
crd::s3,
3335
k8s_openapi::{
@@ -55,11 +57,11 @@ use stackable_operator::{
5557
},
5658
},
5759
role_utils::RoleGroupRef,
60+
shared::time::Duration,
5861
status::condition::{
5962
compute_conditions, operations::ClusterOperationsConditionBuilder,
6063
statefulset::StatefulSetConditionBuilder,
6164
},
62-
time::Duration,
6365
};
6466
use strum::{EnumDiscriminants, IntoStaticStr};
6567

@@ -378,6 +380,11 @@ pub enum Error {
378380

379381
#[snafu(display("failed to configure service"))]
380382
ServiceConfiguration { source: crate::service::Error },
383+
384+
#[snafu(display("failed to resolve product image"))]
385+
ResolveProductImage {
386+
source: product_image_selection::Error,
387+
},
381388
}
382389

383390
type Result<T, E = Error> = std::result::Result<T, E>;
@@ -405,10 +412,11 @@ pub async fn reconcile_druid(
405412
.namespace
406413
.clone()
407414
.with_context(|| ObjectHasNoNamespaceSnafu {})?;
408-
let resolved_product_image: ResolvedProductImage = druid
415+
let resolved_product_image = druid
409416
.spec
410417
.image
411-
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
418+
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
419+
.context(ResolveProductImageSnafu)?;
412420

413421
let zk_confmap = druid.spec.cluster_config.zookeeper_config_map_name.clone();
414422
let zk_connstr = client
@@ -533,7 +541,7 @@ pub async fn reconcile_druid(
533541
let role_group_service_recommended_labels = build_recommended_labels(
534542
druid,
535543
DRUID_CONTROLLER_NAME,
536-
&resolved_product_image.app_version_label,
544+
&resolved_product_image.app_version_label_value,
537545
&rolegroup.role,
538546
&rolegroup.role_group,
539547
);
@@ -624,7 +632,7 @@ pub async fn reconcile_druid(
624632
build_recommended_labels(
625633
druid,
626634
DRUID_CONTROLLER_NAME,
627-
&resolved_product_image.app_version_label,
635+
&resolved_product_image.app_version_label_value,
628636
role_name,
629637
"none",
630638
),
@@ -857,7 +865,7 @@ fn build_rolegroup_config_map(
857865
.with_recommended_labels(build_recommended_labels(
858866
druid,
859867
DRUID_CONTROLLER_NAME,
860-
&resolved_product_image.app_version_label,
868+
&resolved_product_image.app_version_label_value,
861869
&rolegroup.role,
862870
&rolegroup.role_group,
863871
))
@@ -1131,7 +1139,7 @@ fn build_rolegroup_statefulset(
11311139
.with_recommended_labels(build_recommended_labels(
11321140
druid,
11331141
DRUID_CONTROLLER_NAME,
1134-
&resolved_product_image.app_version_label,
1142+
&resolved_product_image.app_version_label_value,
11351143
&rolegroup_ref.role,
11361144
&rolegroup_ref.role_group,
11371145
))
@@ -1190,7 +1198,7 @@ fn build_rolegroup_statefulset(
11901198
.with_recommended_labels(build_recommended_labels(
11911199
druid,
11921200
DRUID_CONTROLLER_NAME,
1193-
&resolved_product_image.app_version_label,
1201+
&resolved_product_image.app_version_label_value,
11941202
&rolegroup_ref.role,
11951203
&rolegroup_ref.role_group,
11961204
))
@@ -1401,7 +1409,8 @@ mod test {
14011409
let resolved_product_image: ResolvedProductImage = druid
14021410
.spec
14031411
.image
1404-
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
1412+
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
1413+
.expect("test: resolved product image is always valid");
14051414
let role_config = transform_all_roles_to_config(&druid, druid.build_role_properties());
14061415

14071416
let product_config_manager =

rust/operator-binary/src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ async fn main() -> anyhow::Result<()> {
6363
Command::Run(ProductOperatorRun {
6464
product_config,
6565
watch_namespace,
66-
telemetry_arguments,
67-
cluster_info_opts,
66+
operator_environment: _,
67+
telemetry,
68+
cluster_info,
6869
}) => {
6970
// NOTE (@NickLarsenNZ): Before stackable-telemetry was used:
7071
// - The console log level was set by `DRUID_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
7172
// - The file log level was set by `DRUID_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
7273
// - The file log directory was set by `DRUID_OPERATOR_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR` (or via `--rolling-logs <DIRECTORY>`).
73-
let _tracing_guard =
74-
Tracing::pre_configured(built_info::PKG_NAME, telemetry_arguments).init()?;
74+
let _tracing_guard = Tracing::pre_configured(built_info::PKG_NAME, telemetry).init()?;
7575

7676
tracing::info!(
7777
built_info.pkg_version = built_info::PKG_VERSION,
@@ -89,7 +89,7 @@ async fn main() -> anyhow::Result<()> {
8989
])?;
9090
let client = stackable_operator::client::initialize_operator(
9191
Some(OPERATOR_NAME.to_string()),
92-
&cluster_info_opts,
92+
&cluster_info,
9393
)
9494
.await?;
9595

rust/operator-binary/src/operations/graceful_shutdown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use snafu::{ResultExt, Snafu};
33
use stackable_operator::{
44
builder::pod::{PodBuilder, container::ContainerBuilder},
55
k8s_openapi::api::core::v1::{ExecAction, LifecycleHandler},
6-
time::Duration,
6+
shared::time::Duration,
77
};
88

99
use crate::crd::{DruidRole, security::DruidTlsSecurity};

0 commit comments

Comments
 (0)