Skip to content

Commit 77f122f

Browse files
committed
fix: Don't panic on invalid authorization config
1 parent 85e5e30 commit 77f122f

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Fixed
66

7+
- Don't panic on invalid authorization config. Previously, a missing OPA ConfigMap would crash the operator ([#XXX]).
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

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)