From 13ac5a5883a0cd320f94a87ed04e435dc3d1a079 Mon Sep 17 00:00:00 2001 From: Techassi Date: Tue, 10 Mar 2026 17:00:04 +0100 Subject: [PATCH 1/2] fix: Delay controller startup to avoid 404 in initial list --- Cargo.lock | 22 +++++------ Cargo.nix | 37 +++++++++---------- Cargo.toml | 2 +- crate-hashes.json | 18 ++++----- .../airflow-operator/templates/roles.yaml | 3 ++ rust/operator-binary/src/main.rs | 11 +++--- .../src/webhooks/conversion.rs | 7 ++-- 7 files changed, 51 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fb0571e7..e333bd07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1568,7 +1568,7 @@ dependencies = [ [[package]] name = "k8s-version" version = "0.1.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#f9b117c8c08557e9774f33145bb009fb74cb2437" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#7486017f60827d1d769d7bf17bf56adb21f8bb02" dependencies = [ "darling", "regex", @@ -2963,7 +2963,7 @@ dependencies = [ [[package]] name = "stackable-certs" version = "0.4.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#f9b117c8c08557e9774f33145bb009fb74cb2437" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#7486017f60827d1d769d7bf17bf56adb21f8bb02" dependencies = [ "const-oid", "ecdsa", @@ -2986,8 +2986,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.106.2" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#f9b117c8c08557e9774f33145bb009fb74cb2437" +version = "0.108.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#7486017f60827d1d769d7bf17bf56adb21f8bb02" dependencies = [ "clap", "const_format", @@ -3026,7 +3026,7 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#f9b117c8c08557e9774f33145bb009fb74cb2437" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#7486017f60827d1d769d7bf17bf56adb21f8bb02" dependencies = [ "darling", "proc-macro2", @@ -3037,7 +3037,7 @@ dependencies = [ [[package]] name = "stackable-shared" version = "0.1.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#f9b117c8c08557e9774f33145bb009fb74cb2437" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#7486017f60827d1d769d7bf17bf56adb21f8bb02" dependencies = [ "jiff", "k8s-openapi", @@ -3053,8 +3053,8 @@ dependencies = [ [[package]] name = "stackable-telemetry" -version = "0.6.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#f9b117c8c08557e9774f33145bb009fb74cb2437" +version = "0.6.2" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#7486017f60827d1d769d7bf17bf56adb21f8bb02" dependencies = [ "axum", "clap", @@ -3078,7 +3078,7 @@ dependencies = [ [[package]] name = "stackable-versioned" version = "0.8.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#f9b117c8c08557e9774f33145bb009fb74cb2437" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#7486017f60827d1d769d7bf17bf56adb21f8bb02" dependencies = [ "schemars", "serde", @@ -3091,7 +3091,7 @@ dependencies = [ [[package]] name = "stackable-versioned-macros" version = "0.8.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#f9b117c8c08557e9774f33145bb009fb74cb2437" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#7486017f60827d1d769d7bf17bf56adb21f8bb02" dependencies = [ "convert_case", "convert_case_extras", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "stackable-webhook" version = "0.9.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#f9b117c8c08557e9774f33145bb009fb74cb2437" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#7486017f60827d1d769d7bf17bf56adb21f8bb02" dependencies = [ "arc-swap", "async-trait", diff --git a/Cargo.nix b/Cargo.nix index 58729c37..abbbf4e5 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -5053,7 +5053,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "f9b117c8c08557e9774f33145bb009fb74cb2437"; + rev = "7486017f60827d1d769d7bf17bf56adb21f8bb02"; sha256 = "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c"; }; libName = "k8s_version"; @@ -9838,7 +9838,7 @@ rec { { name = "stackable-operator"; packageId = "stackable-operator"; - features = [ "telemetry" "versioned" "webhook" ]; + features = [ "crds" "webhook" ]; } { name = "strum"; @@ -9881,7 +9881,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "f9b117c8c08557e9774f33145bb009fb74cb2437"; + rev = "7486017f60827d1d769d7bf17bf56adb21f8bb02"; sha256 = "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c"; }; libName = "stackable_certs"; @@ -9979,12 +9979,12 @@ rec { }; "stackable-operator" = rec { crateName = "stackable-operator"; - version = "0.106.2"; + version = "0.108.0"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "f9b117c8c08557e9774f33145bb009fb74cb2437"; + rev = "7486017f60827d1d769d7bf17bf56adb21f8bb02"; sha256 = "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c"; }; libName = "stackable_operator"; @@ -10092,12 +10092,11 @@ rec { { name = "stackable-shared"; packageId = "stackable-shared"; - features = [ "time" "jiff" ]; + features = [ "jiff" ]; } { name = "stackable-telemetry"; packageId = "stackable-telemetry"; - optional = true; features = [ "clap" ]; } { @@ -10141,14 +10140,14 @@ rec { ]; features = { "certs" = [ "dep:stackable-certs" ]; - "default" = [ "telemetry" "versioned" "clap" ]; - "full" = [ "certs" "telemetry" "versioned" "time" "webhook" "clap" ]; - "telemetry" = [ "dep:stackable-telemetry" ]; + "crds" = [ "dep:stackable-versioned" ]; + "default" = [ "crds" ]; + "full" = [ "crds" "certs" "time" "webhook" "kube-ws" ]; + "kube-ws" = [ "kube/ws" ]; "time" = [ "stackable-shared/time" ]; - "versioned" = [ "dep:stackable-versioned" ]; "webhook" = [ "dep:stackable-webhook" ]; }; - resolvedDefaultFeatures = [ "clap" "default" "telemetry" "versioned" "webhook" ]; + resolvedDefaultFeatures = [ "crds" "default" "webhook" ]; }; "stackable-operator-derive" = rec { crateName = "stackable-operator-derive"; @@ -10157,7 +10156,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "f9b117c8c08557e9774f33145bb009fb74cb2437"; + rev = "7486017f60827d1d769d7bf17bf56adb21f8bb02"; sha256 = "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c"; }; procMacro = true; @@ -10192,7 +10191,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "f9b117c8c08557e9774f33145bb009fb74cb2437"; + rev = "7486017f60827d1d769d7bf17bf56adb21f8bb02"; sha256 = "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c"; }; libName = "stackable_shared"; @@ -10268,12 +10267,12 @@ rec { }; "stackable-telemetry" = rec { crateName = "stackable-telemetry"; - version = "0.6.1"; + version = "0.6.2"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "f9b117c8c08557e9774f33145bb009fb74cb2437"; + rev = "7486017f60827d1d769d7bf17bf56adb21f8bb02"; sha256 = "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c"; }; libName = "stackable_telemetry"; @@ -10383,7 +10382,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "f9b117c8c08557e9774f33145bb009fb74cb2437"; + rev = "7486017f60827d1d769d7bf17bf56adb21f8bb02"; sha256 = "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c"; }; libName = "stackable_versioned"; @@ -10427,7 +10426,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "f9b117c8c08557e9774f33145bb009fb74cb2437"; + rev = "7486017f60827d1d769d7bf17bf56adb21f8bb02"; sha256 = "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c"; }; procMacro = true; @@ -10495,7 +10494,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "f9b117c8c08557e9774f33145bb009fb74cb2437"; + rev = "7486017f60827d1d769d7bf17bf56adb21f8bb02"; sha256 = "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c"; }; libName = "stackable_webhook"; diff --git a/Cargo.toml b/Cargo.toml index ef37b3ec..8b72d390 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/airflow-operator" [workspace.dependencies] product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.8.0" } -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned", "webhook"], tag = "stackable-operator-0.106.2" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["crds", "webhook"], tag = "stackable-operator-0.108.0" } anyhow = "1.0" base64 = "0.22" diff --git a/crate-hashes.json b/crate-hashes.json index b41e87f3..b8d22d86 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -4,14 +4,14 @@ "git+https://github.com/kube-rs/kube-rs?rev=fe69cc486ff8e62a7da61d64ec3ebbd9e64c43b5#kube-derive@3.0.1": "1irm4g79crlxjm3iqrgvx0f6wxdcj394ky84q89pk9i36y2mlw3n", "git+https://github.com/kube-rs/kube-rs?rev=fe69cc486ff8e62a7da61d64ec3ebbd9e64c43b5#kube-runtime@3.0.1": "1irm4g79crlxjm3iqrgvx0f6wxdcj394ky84q89pk9i36y2mlw3n", "git+https://github.com/kube-rs/kube-rs?rev=fe69cc486ff8e62a7da61d64ec3ebbd9e64c43b5#kube@3.0.1": "1irm4g79crlxjm3iqrgvx0f6wxdcj394ky84q89pk9i36y2mlw3n", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#k8s-version@0.1.3": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#stackable-certs@0.4.0": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#stackable-operator-derive@0.3.1": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#stackable-operator@0.106.2": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#stackable-shared@0.1.0": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#stackable-telemetry@0.6.1": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#stackable-versioned-macros@0.8.3": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#stackable-versioned@0.8.3": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.106.2#stackable-webhook@0.9.0": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#k8s-version@0.1.3": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#stackable-certs@0.4.0": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#stackable-operator-derive@0.3.1": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#stackable-operator@0.108.0": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#stackable-shared@0.1.0": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#stackable-telemetry@0.6.2": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#stackable-versioned-macros@0.8.3": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#stackable-versioned@0.8.3": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.108.0#stackable-webhook@0.9.0": "1yg7hbpgclp1zvfnhi4qkrwbgsa19v86plh77vqvwxzdxxxvxr4c", "git+https://github.com/stackabletech/product-config.git?tag=0.8.0#product-config@0.8.0": "1dz70kapm2wdqcr7ndyjji0lhsl98bsq95gnb2lw487wf6yr7987" } \ No newline at end of file diff --git a/deploy/helm/airflow-operator/templates/roles.yaml b/deploy/helm/airflow-operator/templates/roles.yaml index 04dbbbcb..8747fdf5 100644 --- a/deploy/helm/airflow-operator/templates/roles.yaml +++ b/deploy/helm/airflow-operator/templates/roles.yaml @@ -96,6 +96,9 @@ rules: {{- if .Values.maintenance.customResourceDefinitions.maintain }} - create - patch + # Required for startup condition + - list + - watch {{- end }} - apiGroups: - listeners.stackable.tech diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 3a1f8654..a84f50e3 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -17,7 +17,7 @@ use stackable_operator::{ core::v1::{ConfigMap, Service}, }, kube::{ - ResourceExt, + CustomResourceExt, ResourceExt, core::DeserializeGuard, runtime::{ Controller, @@ -29,12 +29,12 @@ use stackable_operator::{ logging::controller::report_controller_reconciled, shared::yaml::SerializeOptions, telemetry::Tracing, - utils::signal::SignalWatcher, + utils::signal::{self, SignalWatcher}, }; use crate::{ airflow_controller::AIRFLOW_FULL_CONTROLLER_NAME, - crd::{AirflowCluster, AirflowClusterVersion, OPERATOR_NAME, v1alpha2}, + crd::{AirflowCluster, AirflowClusterVersion, OPERATOR_NAME, v1alpha1, v1alpha2}, webhooks::conversion::create_webhook_server, }; @@ -192,7 +192,7 @@ async fn main() -> anyhow::Result<()> { ) .map(anyhow::Ok); - let (webhook_server, initial_reconcile_rx) = create_webhook_server( + let webhook_server = create_webhook_server( &operator_environment, maintenance.disable_crd_maintenance, client.as_kube_client(), @@ -204,7 +204,8 @@ async fn main() -> anyhow::Result<()> { .map_err(|err| anyhow!(err).context("failed to run webhook server")); let delayed_airflow_controller = async { - let _ = initial_reconcile_rx.await; + signal::crd_established(&client, v1alpha1::AirflowCluster::crd_name(), None) + .await?; airflow_controller.await }; diff --git a/rust/operator-binary/src/webhooks/conversion.rs b/rust/operator-binary/src/webhooks/conversion.rs index 097a03b4..f75a570e 100644 --- a/rust/operator-binary/src/webhooks/conversion.rs +++ b/rust/operator-binary/src/webhooks/conversion.rs @@ -7,7 +7,6 @@ use stackable_operator::{ webhooks::{ConversionWebhook, ConversionWebhookOptions}, }, }; -use tokio::sync::oneshot; use crate::crd::{AirflowCluster, AirflowClusterVersion, FIELD_MANAGER}; @@ -27,7 +26,7 @@ pub async fn create_webhook_server( operator_environment: &OperatorEnvironmentOptions, disable_crd_maintenance: bool, client: Client, -) -> Result<(WebhookServer, oneshot::Receiver<()>), Error> { +) -> Result { let crds_and_handlers = vec![( AirflowCluster::merged_crd(AirflowClusterVersion::V1Alpha2).context(MergeCrdSnafu)?, AirflowCluster::try_convert, @@ -38,7 +37,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 { @@ -52,5 +51,5 @@ pub async fn create_webhook_server( .await .context(CreateWebhookSnafu)?; - Ok((webhook_server, initial_reconcile_rx)) + Ok(webhook_server) } From fd2c7ffd0abe0ca1b4a146f9cc8f7c15c5a76afa Mon Sep 17 00:00:00 2001 From: Techassi Date: Tue, 10 Mar 2026 17:02:36 +0100 Subject: [PATCH 2/2] chore: Add changelog entry --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db2936e8..0626c75c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,13 +12,13 @@ ### Changed -- Bump stackable-operator to 0.106.2, strum to 0.28, and rand to 0.10 ([#752]). +- Bump stackable-operator to 0.108.0, strum to 0.28, and rand to 0.10 ([#752], [#759]). - Gracefully shutdown all concurrent tasks by forwarding the SIGTERM signal ([#741]). - Bump testing-tools to `0.3.0-stackable0.0.0-dev` ([#733]). ### Fixed -- Fix "404 page not found" error for the initial object list ([#756]). +- Fix "404 page not found" error for the initial object list ([#756], [#759]). - 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]). @@ -32,6 +32,7 @@ [#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 +[#759]: https://github.com/stackabletech/airflow-operator/pull/759 ## [25.11.0] - 2025-11-07