Skip to content

Commit 4d35655

Browse files
authored
fix: Don't panic on invalid authorization config (#667)
* fix: Don't panic on invalid authorization config * changelog
1 parent 85e5e30 commit 4d35655

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
### Fixed
66

7+
- Don't panic on invalid authorization config. Previously, a missing OPA ConfigMap would crash the operator ([#667]).
78
- getting_started: Add a 120 second timeout before trying to enable the DAG ([#665]).
89

910
[#665]: https://github.com/stackabletech/airflow-operator/pull/665
11+
[#667]: https://github.com/stackabletech/airflow-operator/pull/667
1012

1113
## [25.7.0] - 2025-07-23
1214

rust/operator-binary/src/airflow_controller.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,11 @@ pub enum Error {
346346

347347
#[snafu(display("failed to configure service"))]
348348
ServiceConfiguration { source: crate::service::Error },
349+
350+
#[snafu(display("invalid authorization config"))]
351+
InvalidAuthorizationConfig {
352+
source: stackable_operator::commons::opa::Error,
353+
},
349354
}
350355

351356
type Result<T, E = Error> = std::result::Result<T, E>;
@@ -390,7 +395,7 @@ pub async fn reconcile_airflow(
390395
&airflow.spec.cluster_config.authorization,
391396
)
392397
.await
393-
.unwrap();
398+
.context(InvalidAuthorizationConfigSnafu)?;
394399

395400
let mut roles = HashMap::new();
396401

@@ -918,7 +923,7 @@ fn build_server_rolegroup_statefulset(
918923
"kubectl.kubernetes.io/default-container",
919924
format!("{}", Container::Airflow),
920925
))
921-
.unwrap(),
926+
.expect("static annotation is always valid"),
922927
)
923928
.build();
924929

0 commit comments

Comments
 (0)