Skip to content

Commit 82eaef1

Browse files
authored
chore: Update to stackable-operator 0.95.0 (#887)
1 parent 0ac448c commit 82eaef1

File tree

8 files changed

+1638
-1283
lines changed

8 files changed

+1638
-1283
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/kafka-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 = "0.3"
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/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ use stackable_operator::{
3333
product_logging::{self, spec::Logging},
3434
role_utils::{GenericRoleConfig, JavaCommonConfig, Role, RoleGroup, RoleGroupRef},
3535
schemars::{self, JsonSchema},
36+
shared::time::Duration,
3637
status::condition::{ClusterCondition, HasStatusCondition},
37-
time::Duration,
3838
utils::cluster_info::KubernetesClusterInfo,
3939
versioned::versioned,
4040
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use stackable_operator::{
2323
product_logging::framework::{
2424
create_vector_shutdown_file_command, remove_vector_shutdown_file_command,
2525
},
26-
time::Duration,
26+
shared::time::Duration,
2727
utils::COMMON_BASH_TRAP_FUNCTIONS,
2828
};
2929

rust/operator-binary/src/kafka_controller.rs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ use stackable_operator::{
2828
},
2929
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
3030
commons::{
31-
opa::OpaApiVersion, product_image_selection::ResolvedProductImage,
31+
opa::OpaApiVersion,
32+
product_image_selection::{self, ResolvedProductImage},
3233
rbac::build_rbac_resources,
3334
},
3435
crd::{authentication::core, listener},
@@ -62,11 +63,11 @@ use stackable_operator::{
6263
},
6364
},
6465
role_utils::{GenericRoleConfig, RoleGroupRef},
66+
shared::time::Duration,
6567
status::condition::{
6668
compute_conditions, operations::ClusterOperationsConditionBuilder,
6769
statefulset::StatefulSetConditionBuilder,
6870
},
69-
time::Duration,
7071
utils::cluster_info::KubernetesClusterInfo,
7172
};
7273
use strum::{EnumDiscriminants, IntoStaticStr};
@@ -342,6 +343,11 @@ pub enum Error {
342343

343344
#[snafu(display("failed to construct JVM arguments"))]
344345
ConstructJvmArguments { source: crate::config::jvm::Error },
346+
347+
#[snafu(display("failed to resolve product image"))]
348+
ResolveProductImage {
349+
source: product_image_selection::Error,
350+
},
345351
}
346352
type Result<T, E = Error> = std::result::Result<T, E>;
347353

@@ -408,6 +414,7 @@ impl ReconcilerError for Error {
408414
Error::FailedToValidateAuthenticationMethod { .. } => None,
409415
Error::InvalidKafkaCluster { .. } => None,
410416
Error::ConstructJvmArguments { .. } => None,
417+
Error::ResolveProductImage { .. } => None,
411418
}
412419
}
413420
}
@@ -430,7 +437,8 @@ pub async fn reconcile_kafka(
430437
let resolved_product_image = kafka
431438
.spec
432439
.image
433-
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
440+
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
441+
.context(ResolveProductImageSnafu)?;
434442

435443
let mut cluster_resources = ClusterResources::new(
436444
APP_NAME,
@@ -649,7 +657,7 @@ pub fn build_broker_rolegroup_bootstrap_listener(
649657
.with_recommended_labels(build_recommended_labels(
650658
kafka,
651659
KAFKA_CONTROLLER_NAME,
652-
&resolved_product_image.app_version_label,
660+
&resolved_product_image.app_version_label_value,
653661
&rolegroup.role,
654662
&rolegroup.role_group,
655663
))
@@ -707,7 +715,7 @@ fn build_broker_rolegroup_config_map(
707715
.with_recommended_labels(build_recommended_labels(
708716
kafka,
709717
KAFKA_CONTROLLER_NAME,
710-
&resolved_product_image.app_version_label,
718+
&resolved_product_image.app_version_label_value,
711719
&rolegroup.role,
712720
&rolegroup.role_group,
713721
))
@@ -764,7 +772,7 @@ fn build_broker_rolegroup_service(
764772
.with_recommended_labels(build_recommended_labels(
765773
kafka,
766774
KAFKA_CONTROLLER_NAME,
767-
&resolved_product_image.app_version_label,
775+
&resolved_product_image.app_version_label_value,
768776
&rolegroup.role,
769777
&rolegroup.role_group,
770778
))
@@ -813,7 +821,7 @@ fn build_broker_rolegroup_statefulset(
813821
let recommended_object_labels = build_recommended_labels(
814822
kafka,
815823
KAFKA_CONTROLLER_NAME,
816-
&resolved_product_image.app_version_label,
824+
&resolved_product_image.app_version_label_value,
817825
&rolegroup_ref.role,
818826
&rolegroup_ref.role_group,
819827
);
@@ -1134,7 +1142,7 @@ fn build_broker_rolegroup_statefulset(
11341142
.with_recommended_labels(build_recommended_labels(
11351143
kafka,
11361144
KAFKA_CONTROLLER_NAME,
1137-
&resolved_product_image.app_version_label,
1145+
&resolved_product_image.app_version_label_value,
11381146
&rolegroup_ref.role,
11391147
&rolegroup_ref.role_group,
11401148
))

rust/operator-binary/src/main.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ async fn main() -> anyhow::Result<()> {
7878
ProductOperatorRun {
7979
product_config,
8080
watch_namespace,
81-
telemetry_arguments,
82-
cluster_info_opts,
81+
operator_environment: _,
82+
telemetry,
83+
cluster_info,
8384
},
8485
..
8586
}) => {
8687
// NOTE (@NickLarsenNZ): Before stackable-telemetry was used:
8788
// - The console log level was set by `KAFKA_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
8889
// - The file log level was set by `KAFKA_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
8990
// - The file log directory was set by `KAFKA_OPERATOR_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR` (or via `--rolling-logs <DIRECTORY>`).
90-
let _tracing_guard =
91-
Tracing::pre_configured(built_info::PKG_NAME, telemetry_arguments).init()?;
91+
let _tracing_guard = Tracing::pre_configured(built_info::PKG_NAME, telemetry).init()?;
9292

9393
tracing::info!(
9494
built_info.pkg_version = built_info::PKG_VERSION,
@@ -104,8 +104,7 @@ async fn main() -> anyhow::Result<()> {
104104
"/etc/stackable/kafka-operator/config-spec/properties.yaml",
105105
])?;
106106
let client =
107-
client::initialize_operator(Some(OPERATOR_NAME.to_string()), &cluster_info_opts)
108-
.await?;
107+
client::initialize_operator(Some(OPERATOR_NAME.to_string()), &cluster_info).await?;
109108
create_controller(client, product_config, watch_namespace).await;
110109
}
111110
};

0 commit comments

Comments
 (0)