From 8737c52f8d93d83ed13455e0ee84665432161dfa Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 9 Mar 2026 11:40:24 +0100 Subject: [PATCH 1/2] fix: Delay controller startup to avoid 404 in initial list --- rust/operator-binary/src/main.rs | 9 +++++++-- rust/operator-binary/src/webhooks/conversion.rs | 14 +++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 87cb794d..3a1f8654 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -192,7 +192,7 @@ async fn main() -> anyhow::Result<()> { ) .map(anyhow::Ok); - let webhook_server = create_webhook_server( + let (webhook_server, initial_reconcile_rx) = create_webhook_server( &operator_environment, maintenance.disable_crd_maintenance, client.as_kube_client(), @@ -203,7 +203,12 @@ async fn main() -> anyhow::Result<()> { .run(sigterm_watcher.handle()) .map_err(|err| anyhow!(err).context("failed to run webhook server")); - futures::try_join!(airflow_controller, webhook_server, eos_checker)?; + let delayed_airflow_controller = async { + let _ = initial_reconcile_rx.await; + airflow_controller.await + }; + + futures::try_join!(delayed_airflow_controller, webhook_server, eos_checker)?; } } diff --git a/rust/operator-binary/src/webhooks/conversion.rs b/rust/operator-binary/src/webhooks/conversion.rs index f7b5f857..097a03b4 100644 --- a/rust/operator-binary/src/webhooks/conversion.rs +++ b/rust/operator-binary/src/webhooks/conversion.rs @@ -7,6 +7,7 @@ use stackable_operator::{ webhooks::{ConversionWebhook, ConversionWebhookOptions}, }, }; +use tokio::sync::oneshot; use crate::crd::{AirflowCluster, AirflowClusterVersion, FIELD_MANAGER}; @@ -26,7 +27,7 @@ pub async fn create_webhook_server( operator_environment: &OperatorEnvironmentOptions, disable_crd_maintenance: bool, client: Client, -) -> Result { +) -> Result<(WebhookServer, oneshot::Receiver<()>), Error> { let crds_and_handlers = vec![( AirflowCluster::merged_crd(AirflowClusterVersion::V1Alpha2).context(MergeCrdSnafu)?, AirflowCluster::try_convert, @@ -37,7 +38,7 @@ pub async fn create_webhook_server( field_manager: FIELD_MANAGER.to_owned(), }; - let (conversion_webhook, _initial_reconcile_rx) = + let (conversion_webhook, initial_reconcile_rx) = ConversionWebhook::new(crds_and_handlers, client, conversion_webhook_options); let webhook_server_options = WebhookServerOptions { @@ -46,7 +47,10 @@ pub async fn create_webhook_server( webhook_service_name: operator_environment.operator_service_name.to_owned(), }; - WebhookServer::new(vec![Box::new(conversion_webhook)], webhook_server_options) - .await - .context(CreateWebhookSnafu) + let webhook_server = + WebhookServer::new(vec![Box::new(conversion_webhook)], webhook_server_options) + .await + .context(CreateWebhookSnafu)?; + + Ok((webhook_server, initial_reconcile_rx)) } From 96679126cb25fb876ac1f6fbc6e0c8d0461a4fd0 Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 9 Mar 2026 11:49:53 +0100 Subject: [PATCH 2/2] chore: Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e5b3f2c..db2936e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ ### Fixed +- Fix "404 page not found" error for the initial object list ([#756]). - Default `API_WORKERS` to 1 (instead of letting Airflow default to 4) to prevent crashloop and update/correct docs to reflect this ([#727]). - Prevent unnecessary Pod restarts when initially creating an AirflowCluster. This is achieved by applying the StatefulSet after all ConfigMaps and Secrets that it mounts ([#734]). @@ -30,6 +31,7 @@ [#741]: https://github.com/stackabletech/airflow-operator/pull/741 [#742]: https://github.com/stackabletech/airflow-operator/pull/742 [#752]: https://github.com/stackabletech/airflow-operator/pull/752 +[#756]: https://github.com/stackabletech/airflow-operator/pull/756 ## [25.11.0] - 2025-11-07