Skip to content

Commit eb14dc9

Browse files
authored
chore: Update to stackable-operator 0.95.0 (#759)
1 parent a00c462 commit eb14dc9

File tree

11 files changed

+677
-497
lines changed

11 files changed

+677
-497
lines changed

Cargo.lock

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

Cargo.nix

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/opa-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
krb5 = { git = "https://github.com/stackabletech/krb5-rs.git", tag = "v0.1.0" }
1616

1717

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/bundle-builder/src/main.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,9 @@ async fn main() -> Result<(), StartupError> {
8383
// - The console log level was set by `OPA_BUNDLE_BUILDER_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
8484
// - The file log level was set by `OPA_BUNDLE_BUILDER_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
8585
// - The file log directory was set by `OPA_BUNDLE_BUILDER_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR` (or via `--rolling-logs <DIRECTORY>`).
86-
let _tracing_guard =
87-
Tracing::pre_configured(built_info::PKG_NAME, args.common.telemetry_arguments)
88-
.init()
89-
.context(TracingInitSnafu)?;
86+
let _tracing_guard = Tracing::pre_configured(built_info::PKG_NAME, args.common.telemetry)
87+
.init()
88+
.context(TracingInitSnafu)?;
9089

9190
tracing::info!(
9291
built_info.pkg_version = built_info::PKG_VERSION,
@@ -97,10 +96,9 @@ async fn main() -> Result<(), StartupError> {
9796
"Starting bundle-builder",
9897
);
9998

100-
let client =
101-
stackable_operator::client::initialize_operator(None, &args.common.cluster_info_opts)
102-
.await
103-
.context(InitKubeSnafu)?;
99+
let client = stackable_operator::client::initialize_operator(None, &args.common.cluster_info)
100+
.await
101+
.context(InitKubeSnafu)?;
104102

105103
let (store, store_w) = reflector::store();
106104
let rebuild_bundle = || {

rust/operator-binary/src/controller.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use stackable_operator::{
2828
},
2929
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
3030
commons::{
31-
product_image_selection::ResolvedProductImage,
31+
product_image_selection::{self, ResolvedProductImage},
3232
rbac::build_rbac_resources,
3333
secret_class::{SecretClassVolume, SecretClassVolumeScope},
3434
tls_verification::{TlsClientDetails, TlsClientDetailsError},
@@ -65,11 +65,11 @@ use stackable_operator::{
6565
},
6666
},
6767
role_utils::RoleGroupRef,
68+
shared::time::Duration,
6869
status::condition::{
6970
compute_conditions, daemonset::DaemonSetConditionBuilder,
7071
operations::ClusterOperationsConditionBuilder,
7172
},
72-
time::Duration,
7373
utils::{COMMON_BASH_TRAP_FUNCTIONS, cluster_info::KubernetesClusterInfo},
7474
};
7575
use strum::{EnumDiscriminants, IntoStaticStr};
@@ -329,6 +329,11 @@ pub enum Error {
329329
AddVolumeMount {
330330
source: builder::pod::container::Error,
331331
},
332+
333+
#[snafu(display("failed to resolve product image"))]
334+
ResolveProductImage {
335+
source: product_image_selection::Error,
336+
},
332337
}
333338
type Result<T, E = Error> = std::result::Result<T, E>;
334339

@@ -428,7 +433,8 @@ pub async fn reconcile_opa(
428433
let resolved_product_image = opa
429434
.spec
430435
.image
431-
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
436+
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
437+
.context(ResolveProductImageSnafu)?;
432438
let opa_role = v1alpha1::OpaRole::Server;
433439

434440
let mut cluster_resources = ClusterResources::new(
@@ -629,7 +635,7 @@ pub fn build_server_role_service(
629635
.context(ObjectMissingMetadataForOwnerRefSnafu)?
630636
.with_recommended_labels(build_recommended_labels(
631637
opa,
632-
&resolved_product_image.app_version_label,
638+
&resolved_product_image.app_version_label_value,
633639
&role_name,
634640
"global",
635641
))
@@ -669,7 +675,7 @@ fn build_rolegroup_headless_service(
669675
.context(ObjectMissingMetadataForOwnerRefSnafu)?
670676
.with_recommended_labels(build_recommended_labels(
671677
opa,
672-
&resolved_product_image.app_version_label,
678+
&resolved_product_image.app_version_label_value,
673679
&rolegroup.role,
674680
&rolegroup.role_group,
675681
))
@@ -716,7 +722,7 @@ fn build_rolegroup_metrics_service(
716722
.context(ObjectMissingMetadataForOwnerRefSnafu)?
717723
.with_recommended_labels(build_recommended_labels(
718724
opa,
719-
&resolved_product_image.app_version_label,
725+
&resolved_product_image.app_version_label_value,
720726
&rolegroup.role,
721727
&rolegroup.role_group,
722728
))
@@ -764,7 +770,7 @@ fn build_server_rolegroup_config_map(
764770
.context(ObjectMissingMetadataForOwnerRefSnafu)?
765771
.with_recommended_labels(build_recommended_labels(
766772
opa,
767-
&resolved_product_image.app_version_label,
773+
&resolved_product_image.app_version_label_value,
768774
&rolegroup.role,
769775
&rolegroup.role_group,
770776
))
@@ -1009,7 +1015,7 @@ fn build_server_rolegroup_daemonset(
10091015
let pb_metadata = ObjectMetaBuilder::new()
10101016
.with_recommended_labels(build_recommended_labels(
10111017
opa,
1012-
&resolved_product_image.app_version_label,
1018+
&resolved_product_image.app_version_label_value,
10131019
&rolegroup_ref.role,
10141020
&rolegroup_ref.role_group,
10151021
))
@@ -1208,7 +1214,7 @@ fn build_server_rolegroup_daemonset(
12081214
.context(ObjectMissingMetadataForOwnerRefSnafu)?
12091215
.with_recommended_labels(build_recommended_labels(
12101216
opa,
1211-
&resolved_product_image.app_version_label,
1217+
&resolved_product_image.app_version_label_value,
12121218
&rolegroup_ref.role,
12131219
&rolegroup_ref.role_group,
12141220
))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ use stackable_operator::{
2424
EmptyRoleConfig, GenericProductSpecificCommonConfig, Role, RoleGroup, RoleGroupRef,
2525
},
2626
schemars::{self, JsonSchema},
27+
shared::time::Duration,
2728
status::condition::{ClusterCondition, HasStatusCondition},
28-
time::Duration,
2929
utils::cluster_info::KubernetesClusterInfo,
3030
versioned::versioned,
3131
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use stackable_operator::{
77
tls_verification::{CaCert, Tls, TlsClientDetails, TlsServerVerification, TlsVerification},
88
},
99
schemars::{self, JsonSchema},
10-
time::Duration,
10+
shared::time::Duration,
1111
versioned::versioned,
1212
};
1313

rust/operator-binary/src/discovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fn build_discovery_configmap(
8484
})?
8585
.with_recommended_labels(build_recommended_labels(
8686
opa,
87-
&resolved_product_image.app_version_label,
87+
&resolved_product_image.app_version_label_value,
8888
&v1alpha1::OpaRole::Server.to_string(),
8989
"discovery",
9090
))

rust/operator-binary/src/main.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ async fn main() -> anyhow::Result<()> {
7373
ProductOperatorRun {
7474
product_config,
7575
watch_namespace,
76-
telemetry_arguments,
77-
cluster_info_opts,
76+
operator_environment: _,
77+
telemetry,
78+
cluster_info,
7879
},
7980
}) => {
8081
// NOTE (@NickLarsenNZ): Before stackable-telemetry was used:
8182
// - The console log level was set by `OPA_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
8283
// - The file log level was set by `OPA_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
8384
// - The file log directory was set by `OPA_OPERATOR_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR` (or via `--rolling-logs <DIRECTORY>`).
84-
let _tracing_guard =
85-
Tracing::pre_configured(built_info::PKG_NAME, telemetry_arguments).init()?;
85+
let _tracing_guard = Tracing::pre_configured(built_info::PKG_NAME, telemetry).init()?;
8686

8787
tracing::info!(
8888
built_info.pkg_version = built_info::PKG_VERSION,
@@ -99,8 +99,7 @@ async fn main() -> anyhow::Result<()> {
9999
])?;
100100

101101
let client =
102-
client::initialize_operator(Some(OPERATOR_NAME.to_string()), &cluster_info_opts)
103-
.await?;
102+
client::initialize_operator(Some(OPERATOR_NAME.to_string()), &cluster_info).await?;
104103
let kubernetes_cluster_info = client.kubernetes_cluster_info.clone();
105104
create_controller(
106105
client,

0 commit comments

Comments
 (0)