Skip to content

Commit c1f9133

Browse files
authored
chore: Update to stackable-operator 0.95.0 (#837)
1 parent 68cf248 commit c1f9133

File tree

10 files changed

+1202
-550
lines changed

10 files changed

+1202
-550
lines changed

Cargo.lock

Lines changed: 306 additions & 193 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/nifi-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
pin-project = "1.1"
2424
rand = "0.9"
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/controller.rs

Lines changed: 18 additions & 9 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
crd::{authentication::oidc::v1alpha1::AuthenticationProvider, git_sync},
3437
k8s_openapi::{
3538
DeepMerge,
@@ -63,11 +66,11 @@ use stackable_operator::{
6366
},
6467
},
6568
role_utils::{GenericRoleConfig, JavaCommonConfig, Role, RoleGroupRef},
69+
shared::time::Duration,
6670
status::condition::{
6771
compute_conditions, operations::ClusterOperationsConditionBuilder,
6872
statefulset::StatefulSetConditionBuilder,
6973
},
70-
time::Duration,
7174
utils::{COMMON_BASH_TRAP_FUNCTIONS, cluster_info::KubernetesClusterInfo},
7275
};
7376
use strum::{EnumDiscriminants, IntoStaticStr};
@@ -353,6 +356,11 @@ pub enum Error {
353356

354357
#[snafu(display("failed to configure service"))]
355358
ServiceConfiguration { source: crate::service::Error },
359+
360+
#[snafu(display("failed to resolve product image"))]
361+
ResolveProductImage {
362+
source: product_image_selection::Error,
363+
},
356364
}
357365

358366
type Result<T, E = Error> = std::result::Result<T, E>;
@@ -376,10 +384,11 @@ pub async fn reconcile_nifi(
376384

377385
let client = &ctx.client;
378386

379-
let resolved_product_image: ResolvedProductImage = nifi
387+
let resolved_product_image = nifi
380388
.spec
381389
.image
382-
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
390+
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
391+
.context(ResolveProductImageSnafu)?;
383392

384393
tracing::info!("Checking for sensitive key configuration");
385394
check_or_generate_sensitive_key(client, nifi)
@@ -497,7 +506,7 @@ pub async fn reconcile_nifi(
497506

498507
let role_group_service_recommended_labels = build_recommended_labels(
499508
nifi,
500-
&resolved_product_image.app_version_label,
509+
&resolved_product_image.app_version_label_value,
501510
&rolegroup.role,
502511
&rolegroup.role_group,
503512
);
@@ -624,7 +633,7 @@ pub async fn reconcile_nifi(
624633
nifi,
625634
build_recommended_labels(
626635
nifi,
627-
&resolved_product_image.app_version_label,
636+
&resolved_product_image.app_version_label_value,
628637
&nifi_role.to_string(),
629638
"none",
630639
),
@@ -747,7 +756,7 @@ async fn build_node_rolegroup_config_map(
747756
.context(ObjectMissingMetadataForOwnerRefSnafu)?
748757
.with_recommended_labels(build_recommended_labels(
749758
nifi,
750-
&resolved_product_image.app_version_label,
759+
&resolved_product_image.app_version_label_value,
751760
&rolegroup.role,
752761
&rolegroup.role_group,
753762
))
@@ -1156,7 +1165,7 @@ async fn build_node_rolegroup_statefulset(
11561165

11571166
let recommended_object_labels = build_recommended_labels(
11581167
nifi,
1159-
&resolved_product_image.app_version_label,
1168+
&resolved_product_image.app_version_label_value,
11601169
&rolegroup_ref.role,
11611170
&rolegroup_ref.role_group,
11621171
);
@@ -1294,7 +1303,7 @@ async fn build_node_rolegroup_statefulset(
12941303
let metadata = ObjectMetaBuilder::new()
12951304
.with_recommended_labels(build_recommended_labels(
12961305
nifi,
1297-
&resolved_product_image.app_version_label,
1306+
&resolved_product_image.app_version_label_value,
12981307
&rolegroup_ref.role,
12991308
&rolegroup_ref.role_group,
13001309
))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ use stackable_operator::{
3636
product_logging::{self, spec::Logging},
3737
role_utils::{GenericRoleConfig, JavaCommonConfig, Role, RoleGroupRef},
3838
schemars::{self, JsonSchema},
39+
shared::time::Duration,
3940
status::condition::{ClusterCondition, HasStatusCondition},
40-
time::Duration,
4141
utils::crds::{raw_object_list_schema, raw_object_schema},
4242
versioned::versioned,
4343
};

rust/operator-binary/src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ async fn main() -> anyhow::Result<()> {
6666
Command::Run(ProductOperatorRun {
6767
product_config,
6868
watch_namespace,
69-
telemetry_arguments,
70-
cluster_info_opts,
69+
operator_environment: _,
70+
telemetry,
71+
cluster_info,
7172
}) => {
7273
// NOTE (@NickLarsenNZ): Before stackable-telemetry was used:
7374
// - The console log level was set by `NIFI_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
7475
// - The file log level was set by `NIFI_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
7576
// - The file log directory was set by `NIFI_OPERATOR_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR` (or via `--rolling-logs <DIRECTORY>`).
76-
let _tracing_guard =
77-
Tracing::pre_configured(built_info::PKG_NAME, telemetry_arguments).init()?;
77+
let _tracing_guard = Tracing::pre_configured(built_info::PKG_NAME, telemetry).init()?;
7878

7979
tracing::info!(
8080
built_info.pkg_version = built_info::PKG_VERSION,
@@ -93,7 +93,7 @@ async fn main() -> anyhow::Result<()> {
9393

9494
let client = stackable_operator::client::initialize_operator(
9595
Some(OPERATOR_NAME.to_string()),
96-
&cluster_info_opts,
96+
&cluster_info,
9797
)
9898
.await?;
9999

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use stackable_operator::{
4444
},
4545
kube::ResourceExt,
4646
kvp::Labels,
47-
time::Duration,
47+
shared::time::Duration,
4848
utils::cluster_info::KubernetesClusterInfo,
4949
};
5050

@@ -230,7 +230,7 @@ fn build_reporting_task_service(
230230
.context(ObjectMissingMetadataForOwnerRefSnafu)?
231231
.with_recommended_labels(build_recommended_labels(
232232
nifi,
233-
&resolved_product_image.app_version_label,
233+
&resolved_product_image.app_version_label_value,
234234
&role_name,
235235
"global",
236236
))
@@ -380,7 +380,7 @@ fn build_reporting_task_job(
380380
.context(ObjectMissingMetadataForOwnerRefSnafu)?
381381
.with_recommended_labels(build_recommended_labels(
382382
nifi,
383-
&resolved_product_image.app_version_label,
383+
&resolved_product_image.app_version_label_value,
384384
"global",
385385
"global",
386386
))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use snafu::{ResultExt, Snafu};
22
use stackable_operator::{
33
builder::pod::volume::SecretFormat, client::Client, k8s_openapi::api::core::v1::Volume,
4-
time::Duration,
4+
shared::time::Duration,
55
};
66

77
use crate::crd::v1alpha1;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use snafu::{ResultExt, Snafu};
22
use stackable_operator::{
33
builder::pod::volume::{SecretFormat, SecretOperatorVolumeSourceBuilder, VolumeBuilder},
44
k8s_openapi::api::core::v1::Volume,
5-
time::Duration,
5+
shared::time::Duration,
66
};
77

88
use crate::{crd::v1alpha1, security::authentication::STACKABLE_TLS_STORE_PASSWORD};

0 commit comments

Comments
 (0)