From 77f122f8c103295742f2be578b6de7ce3725e813 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Thu, 31 Jul 2025 20:08:25 +0200 Subject: [PATCH 1/2] fix: Don't panic on invalid authorization config --- CHANGELOG.md | 1 + rust/operator-binary/src/airflow_controller.rs | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04a5a082..c9e5c4c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Fixed +- Don't panic on invalid authorization config. Previously, a missing OPA ConfigMap would crash the operator ([#XXX]). - getting_started: Add a 120 second timeout before trying to enable the DAG ([#665]). [#665]: https://github.com/stackabletech/airflow-operator/pull/665 diff --git a/rust/operator-binary/src/airflow_controller.rs b/rust/operator-binary/src/airflow_controller.rs index ddb972f3..fa526521 100644 --- a/rust/operator-binary/src/airflow_controller.rs +++ b/rust/operator-binary/src/airflow_controller.rs @@ -346,6 +346,11 @@ pub enum Error { #[snafu(display("failed to configure service"))] ServiceConfiguration { source: crate::service::Error }, + + #[snafu(display("invalid authorization config"))] + InvalidAuthorizationConfig { + source: stackable_operator::commons::opa::Error, + }, } type Result = std::result::Result; @@ -390,7 +395,7 @@ pub async fn reconcile_airflow( &airflow.spec.cluster_config.authorization, ) .await - .unwrap(); + .context(InvalidAuthorizationConfigSnafu)?; let mut roles = HashMap::new(); @@ -918,7 +923,7 @@ fn build_server_rolegroup_statefulset( "kubectl.kubernetes.io/default-container", format!("{}", Container::Airflow), )) - .unwrap(), + .expect("static annotation is always valid"), ) .build(); From 39aff571a5c6cf8b44a57da09e4650c324ee11c6 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Thu, 31 Jul 2025 20:09:32 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9e5c4c1..87ffaaf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,11 @@ ### Fixed -- Don't panic on invalid authorization config. Previously, a missing OPA ConfigMap would crash the operator ([#XXX]). +- Don't panic on invalid authorization config. Previously, a missing OPA ConfigMap would crash the operator ([#667]). - getting_started: Add a 120 second timeout before trying to enable the DAG ([#665]). [#665]: https://github.com/stackabletech/airflow-operator/pull/665 +[#667]: https://github.com/stackabletech/airflow-operator/pull/667 ## [25.7.0] - 2025-07-23