Skip to content

Commit ce469d2

Browse files
authored
chore: Update to stackable-operator 0.95.0 (#675)
1 parent e7b5927 commit ce469d2

File tree

10 files changed

+1212
-557
lines changed

10 files changed

+1212
-557
lines changed

Cargo.lock

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

Cargo.nix

Lines changed: 861 additions & 330 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/airflow-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"] }
@@ -20,7 +20,7 @@ const_format = "0.2"
2020
fnv = "1.0"
2121
futures = { version = "0.3", features = ["compat"] }
2222
indoc = "2.0"
23-
rstest = "0.25"
23+
rstest = "0.26"
2424
semver = "1.0"
2525
serde = { version = "1.0", features = ["derive"] }
2626
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/airflow_controller.rs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ use stackable_operator::{
3030
},
3131
},
3232
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
33-
commons::{product_image_selection::ResolvedProductImage, rbac::build_rbac_resources},
33+
commons::{
34+
product_image_selection::{self, ResolvedProductImage},
35+
rbac::build_rbac_resources,
36+
},
3437
config::fragment::ValidationError,
3538
crd::{
3639
authentication::{core as auth_core, ldap},
@@ -68,11 +71,11 @@ use stackable_operator::{
6871
role_utils::{
6972
CommonConfiguration, GenericProductSpecificCommonConfig, GenericRoleConfig, RoleGroupRef,
7073
},
74+
shared::time::Duration,
7175
status::condition::{
7276
compute_conditions, operations::ClusterOperationsConditionBuilder,
7377
statefulset::StatefulSetConditionBuilder,
7478
},
75-
time::Duration,
7679
utils::COMMON_BASH_TRAP_FUNCTIONS,
7780
};
7881
use strum::{EnumDiscriminants, IntoEnumIterator, IntoStaticStr};
@@ -351,6 +354,11 @@ pub enum Error {
351354
InvalidAuthorizationConfig {
352355
source: stackable_operator::commons::opa::Error,
353356
},
357+
358+
#[snafu(display("failed to resolve product image"))]
359+
ResolveProductImage {
360+
source: product_image_selection::Error,
361+
},
354362
}
355363

356364
type Result<T, E = Error> = std::result::Result<T, E>;
@@ -374,10 +382,11 @@ pub async fn reconcile_airflow(
374382
.context(InvalidAirflowClusterSnafu)?;
375383

376384
let client = &ctx.client;
377-
let resolved_product_image: ResolvedProductImage = airflow
385+
let resolved_product_image = airflow
378386
.spec
379387
.image
380-
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
388+
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
389+
.context(ResolveProductImageSnafu)?;
381390

382391
let cluster_operation_cond_builder =
383392
ClusterOperationsConditionBuilder::new(&airflow.spec.cluster_operation);
@@ -506,7 +515,7 @@ pub async fn reconcile_airflow(
506515
let role_group_service_recommended_labels = build_recommended_labels(
507516
airflow,
508517
AIRFLOW_CONTROLLER_NAME,
509-
&resolved_product_image.app_version_label,
518+
&resolved_product_image.app_version_label_value,
510519
&rolegroup.role,
511520
&rolegroup.role_group,
512521
);
@@ -606,7 +615,7 @@ pub async fn reconcile_airflow(
606615
build_recommended_labels(
607616
airflow,
608617
AIRFLOW_CONTROLLER_NAME,
609-
&resolved_product_image.app_version_label,
618+
&resolved_product_image.app_version_label_value,
610619
role_name,
611620
"none",
612621
),
@@ -792,7 +801,7 @@ fn build_rolegroup_config_map(
792801
.with_recommended_labels(build_recommended_labels(
793802
airflow,
794803
AIRFLOW_CONTROLLER_NAME,
795-
&resolved_product_image.app_version_label,
804+
&resolved_product_image.app_version_label_value,
796805
&rolegroup.role,
797806
&rolegroup.role_group,
798807
))
@@ -837,7 +846,7 @@ fn build_rolegroup_metadata(
837846
.with_recommended_labels(build_recommended_labels(
838847
airflow,
839848
AIRFLOW_CONTROLLER_NAME,
840-
&resolved_product_image.app_version_label,
849+
&resolved_product_image.app_version_label_value,
841850
&rolegroup.role,
842851
&rolegroup.role_group,
843852
))
@@ -905,7 +914,7 @@ fn build_server_rolegroup_statefulset(
905914
let recommended_object_labels = build_recommended_labels(
906915
airflow,
907916
AIRFLOW_CONTROLLER_NAME,
908-
&resolved_product_image.app_version_label,
917+
&resolved_product_image.app_version_label_value,
909918
&rolegroup_ref.role,
910919
&rolegroup_ref.role_group,
911920
);
@@ -1219,7 +1228,7 @@ fn build_executor_template_config_map(
12191228
.with_recommended_labels(build_recommended_labels(
12201229
airflow,
12211230
AIRFLOW_CONTROLLER_NAME,
1222-
&resolved_product_image.app_version_label,
1231+
&resolved_product_image.app_version_label_value,
12231232
"executor",
12241233
"executor-template",
12251234
))
@@ -1326,7 +1335,7 @@ fn build_executor_template_config_map(
13261335
.with_recommended_labels(build_recommended_labels(
13271336
airflow,
13281337
AIRFLOW_CONTROLLER_NAME,
1329-
&resolved_product_image.app_version_label,
1338+
&resolved_product_image.app_version_label_value,
13301339
"executor",
13311340
"executor-template",
13321341
))

rust/operator-binary/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ mod tests {
310310
use rstest::rstest;
311311
use stackable_operator::{
312312
crd::authentication::{ldap, oidc},
313-
time::Duration,
313+
shared::time::Duration,
314314
};
315315

316316
use crate::{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use stackable_operator::{client::Client, commons::opa::OpaApiVersion, time::Duration};
1+
use stackable_operator::{client::Client, commons::opa::OpaApiVersion, shared::time::Duration};
22

33
use crate::crd::{AirflowAuthorization, AirflowOpaConfig, v1alpha1};
44

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ use stackable_operator::{
3838
RoleGroup, RoleGroupRef,
3939
},
4040
schemars::{self, JsonSchema},
41+
shared::time::Duration,
4142
status::condition::{ClusterCondition, HasStatusCondition},
42-
time::Duration,
4343
utils::{COMMON_BASH_TRAP_FUNCTIONS, crds::raw_object_list_schema},
4444
versioned::versioned,
4545
};
@@ -1017,8 +1017,11 @@ mod tests {
10171017
let cluster: AirflowCluster =
10181018
serde_yaml::with::singleton_map_recursive::deserialize(deserializer).unwrap();
10191019

1020-
let resolved_airflow_image: ResolvedProductImage =
1021-
cluster.spec.image.resolve("airflow", "0.0.0-dev");
1020+
let resolved_airflow_image: ResolvedProductImage = cluster
1021+
.spec
1022+
.image
1023+
.resolve("airflow", "0.0.0-dev")
1024+
.expect("test: resolved product image is always valid");
10221025

10231026
assert_eq!("2.10.5", &resolved_airflow_image.product_version);
10241027

rust/operator-binary/src/env_vars.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,7 @@ fn execution_server_env_vars(airflow: &v1alpha1::AirflowCluster) -> BTreeMap<Str
641641

642642
#[cfg(test)]
643643
mod tests {
644-
645-
use stackable_operator::time::Duration;
644+
use stackable_operator::shared::time::Duration;
646645

647646
use super::*;
648647
use crate::crd::authorization::OpaConfigResolved;

rust/operator-binary/src/main.rs

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

8080
tracing::info!(
8181
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

0 commit comments

Comments
 (0)