Skip to content

Commit ef53a73

Browse files
authored
chore: Update to stackable-operator 0.95.0 (#791)
* chore: Update to stackable-operator 0.95.0 * use upstream tag
1 parent 3404574 commit ef53a73

File tree

10 files changed

+1191
-541
lines changed

10 files changed

+1191
-541
lines changed

Cargo.lock

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

Cargo.nix

Lines changed: 853 additions & 324 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/trino-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
async-trait = "0.1"
@@ -21,7 +21,7 @@ const_format = "0.2"
2121
futures = { version = "0.3", features = ["compat"] }
2222
indoc = "2.0"
2323
openssl = "0.10"
24-
rstest = "0.25"
24+
rstest = "0.26"
2525
serde = { version = "1.0", features = ["derive"] }
2626
serde_json = "1.0"
2727
serde_yaml = "0.9"

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/authentication/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ mod tests {
670670
fn resolved_product_image() -> ResolvedProductImage {
671671
ResolvedProductImage {
672672
product_version: "".to_string(),
673-
app_version_label: "".to_string(),
673+
app_version_label_value: "470".parse().expect("static label value is always valid"),
674674
image: "".to_string(),
675675
image_pull_policy: "".to_string(),
676676
pull_secrets: None,

rust/operator-binary/src/authentication/password/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ mod tests {
251251
TrinoPasswordAuthentication::new(authenticators)
252252
.password_authentication_config(&ResolvedProductImage {
253253
product_version: "".to_string(),
254-
app_version_label: "".to_string(),
254+
app_version_label_value: "470".parse().expect("static label value is always valid"),
255255
image: "".to_string(),
256256
image_pull_policy: "".to_string(),
257257
pull_secrets: None,

rust/operator-binary/src/controller.rs

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ use stackable_operator::{
2929
},
3030
client::Client,
3131
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
32-
commons::{product_image_selection::ResolvedProductImage, rbac::build_rbac_resources},
32+
commons::{
33+
product_image_selection::{self, ResolvedProductImage},
34+
rbac::build_rbac_resources,
35+
},
3336
k8s_openapi::{
3437
DeepMerge,
3538
api::{
@@ -62,11 +65,11 @@ use stackable_operator::{
6265
},
6366
},
6467
role_utils::{GenericRoleConfig, JavaCommonConfig, Role, RoleGroupRef},
68+
shared::time::Duration,
6569
status::condition::{
6670
compute_conditions, operations::ClusterOperationsConditionBuilder,
6771
statefulset::StatefulSetConditionBuilder,
6872
},
69-
time::Duration,
7073
utils::cluster_info::KubernetesClusterInfo,
7174
};
7275
use strum::{EnumDiscriminants, IntoStaticStr};
@@ -366,6 +369,11 @@ pub enum Error {
366369

367370
#[snafu(display("failed to configure service"))]
368371
ServiceConfiguration { source: crate::service::Error },
372+
373+
#[snafu(display("failed to resolve product image"))]
374+
ResolveProductImage {
375+
source: product_image_selection::Error,
376+
},
369377
}
370378

371379
type Result<T, E = Error> = std::result::Result<T, E>;
@@ -389,10 +397,11 @@ pub async fn reconcile_trino(
389397
.context(InvalidTrinoClusterSnafu)?;
390398
let client = &ctx.client;
391399

392-
let resolved_product_image: ResolvedProductImage = trino
400+
let resolved_product_image = trino
393401
.spec
394402
.image
395-
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
403+
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
404+
.context(ResolveProductImageSnafu)?;
396405

397406
let resolved_authentication_classes =
398407
resolve_authentication_classes(client, trino.get_authentication())
@@ -507,7 +516,7 @@ pub async fn reconcile_trino(
507516

508517
let role_group_service_recommended_labels = build_recommended_labels(
509518
trino,
510-
&resolved_product_image.app_version_label,
519+
&resolved_product_image.app_version_label_value,
511520
&role_group_ref.role,
512521
&role_group_ref.role_group,
513522
);
@@ -612,7 +621,7 @@ pub async fn reconcile_trino(
612621
trino,
613622
build_recommended_labels(
614623
trino,
615-
&resolved_product_image.app_version_label,
624+
&resolved_product_image.app_version_label_value,
616625
&trino_role_str,
617626
"none",
618627
),
@@ -852,7 +861,7 @@ fn build_rolegroup_config_map(
852861
.context(ObjectMissingMetadataForOwnerRefSnafu)?
853862
.with_recommended_labels(build_recommended_labels(
854863
trino,
855-
&resolved_product_image.app_version_label,
864+
&resolved_product_image.app_version_label_value,
856865
&rolegroup_ref.role,
857866
&rolegroup_ref.role_group,
858867
))
@@ -883,7 +892,7 @@ fn build_rolegroup_catalog_config_map(
883892
.context(ObjectMissingMetadataForOwnerRefSnafu)?
884893
.with_recommended_labels(build_recommended_labels(
885894
trino,
886-
&resolved_product_image.app_version_label,
895+
&resolved_product_image.app_version_label_value,
887896
&rolegroup_ref.role,
888897
&rolegroup_ref.role_group,
889898
))
@@ -1198,7 +1207,7 @@ fn build_rolegroup_statefulset(
11981207
let metadata = ObjectMetaBuilder::new()
11991208
.with_recommended_labels(build_recommended_labels(
12001209
trino,
1201-
&resolved_product_image.app_version_label,
1210+
&resolved_product_image.app_version_label_value,
12021211
&role_group_ref.role,
12031212
&role_group_ref.role_group,
12041213
))
@@ -1257,7 +1266,7 @@ fn build_rolegroup_statefulset(
12571266
.context(ObjectMissingMetadataForOwnerRefSnafu)?
12581267
.with_recommended_labels(build_recommended_labels(
12591268
trino,
1260-
&resolved_product_image.app_version_label,
1269+
&resolved_product_image.app_version_label_value,
12611270
&role_group_ref.role,
12621271
&role_group_ref.role_group,
12631272
))
@@ -1762,7 +1771,8 @@ mod tests {
17621771
let resolved_product_image = trino
17631772
.spec
17641773
.image
1765-
.resolve(DOCKER_IMAGE_BASE_NAME, "0.0.0-dev");
1774+
.resolve(DOCKER_IMAGE_BASE_NAME, "0.0.0-dev")
1775+
.expect("test resolved product image is always valid");
17661776

17671777
let config_files = vec![
17681778
PropertyNameKind::File(CONFIG_PROPERTIES.to_string()),

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use stackable_operator::{
1919
apimachinery::pkg::api::resource::Quantity,
2020
},
2121
schemars::{self, JsonSchema},
22-
time::Duration,
22+
shared::time::Duration,
2323
};
2424

2525
use super::catalog::commons::HdfsConnection;
@@ -575,8 +575,6 @@ impl ResolvedFaultTolerantExecutionConfig {
575575

576576
#[cfg(test)]
577577
mod tests {
578-
use stackable_operator::time::Duration;
579-
580578
use super::*;
581579

582580
#[tokio::test]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ use stackable_operator::{
3434
CommonConfiguration, GenericRoleConfig, JavaCommonConfig, Role, RoleGroup, RoleGroupRef,
3535
},
3636
schemars::{self, JsonSchema},
37+
shared::time::Duration,
3738
status::condition::{ClusterCondition, HasStatusCondition},
38-
time::Duration,
3939
utils::cluster_info::KubernetesClusterInfo,
4040
versioned::versioned,
4141
};

rust/operator-binary/src/main.rs

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

8686
tracing::info!(
8787
built_info.pkg_version = built_info::PKG_VERSION,
@@ -99,7 +99,7 @@ async fn main() -> anyhow::Result<()> {
9999

100100
let client = stackable_operator::client::initialize_operator(
101101
Some(OPERATOR_NAME.to_string()),
102-
&cluster_info_opts,
102+
&cluster_info,
103103
)
104104
.await?;
105105
let event_recorder = Arc::new(Recorder::new(

0 commit comments

Comments
 (0)