From d20ea747b74444012f06dc58abf5a92ebd48b749 Mon Sep 17 00:00:00 2001 From: Maxi Wittich Date: Mon, 7 Jul 2025 17:16:07 +0200 Subject: [PATCH 1/2] first working fix --- .../operator-binary/src/airflow_controller.rs | 29 +++++++++---------- rust/operator-binary/src/service.rs | 18 +++++++----- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/rust/operator-binary/src/airflow_controller.rs b/rust/operator-binary/src/airflow_controller.rs index 9f933a35..220c916c 100644 --- a/rust/operator-binary/src/airflow_controller.rs +++ b/rust/operator-binary/src/airflow_controller.rs @@ -514,23 +514,20 @@ pub async fn reconcile_airflow( ) .context(LabelBuildSnafu)?; - // Only apply headless service for something exposing an HTTP port - if airflow_role.get_http_port().is_some() { - let rg_headless_service = build_rolegroup_headless_service( - airflow, - &rolegroup, - role_group_service_recommended_labels.clone(), - role_group_service_selector.clone().into(), - ) - .context(ServiceConfigurationSnafu)?; + let rg_headless_service = build_rolegroup_headless_service( + airflow, + &rolegroup, + role_group_service_recommended_labels.clone(), + role_group_service_selector.clone().into(), + ) + .context(ServiceConfigurationSnafu)?; - cluster_resources - .add(client, rg_headless_service) - .await - .context(ApplyRoleGroupServiceSnafu { - rolegroup: rolegroup.clone(), - })?; - } + cluster_resources + .add(client, rg_headless_service) + .await + .context(ApplyRoleGroupServiceSnafu { + rolegroup: rolegroup.clone(), + })?; let rg_metrics_service = build_rolegroup_metrics_service( airflow, diff --git a/rust/operator-binary/src/service.rs b/rust/operator-binary/src/service.rs index 52ae4d26..8ba89ea0 100644 --- a/rust/operator-binary/src/service.rs +++ b/rust/operator-binary/src/service.rs @@ -111,15 +111,19 @@ pub fn build_rolegroup_metrics_service( } pub fn stateful_set_service_name( - airflow_role: &AirflowRole, + _airflow_role: &AirflowRole, rolegroup_ref: &RoleGroupRef, ) -> Option { - match airflow_role { - AirflowRole::Webserver => Some(rolegroup_headless_service_name( - &rolegroup_ref.object_name(), - )), - AirflowRole::Scheduler | AirflowRole::Worker => None, - } + //match airflow_role { + //AirflowRole::Webserver => Some(rolegroup_headless_service_name( + //&rolegroup_ref.object_name(), + //)), + + //AirflowRole::Scheduler | AirflowRole::Worker => None, + //} + Some(rolegroup_headless_service_name( + &rolegroup_ref.object_name(), + )) } /// Returns the metrics rolegroup service name `---`. From 937faebec73a530506481c8ed784da83c43db1dd Mon Sep 17 00:00:00 2001 From: Maxi Wittich Date: Mon, 7 Jul 2025 17:36:27 +0200 Subject: [PATCH 2/2] Cleanup outdated comments and code --- rust/operator-binary/src/airflow_controller.rs | 2 +- rust/operator-binary/src/service.rs | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/rust/operator-binary/src/airflow_controller.rs b/rust/operator-binary/src/airflow_controller.rs index 220c916c..a4f16cb0 100644 --- a/rust/operator-binary/src/airflow_controller.rs +++ b/rust/operator-binary/src/airflow_controller.rs @@ -1156,7 +1156,7 @@ fn build_server_rolegroup_statefulset( match_labels: Some(statefulset_match_labels.into()), ..LabelSelector::default() }, - service_name: stateful_set_service_name(airflow_role, rolegroup_ref), + service_name: stateful_set_service_name(rolegroup_ref), template: pod_template, volume_claim_templates: pvcs, ..StatefulSetSpec::default() diff --git a/rust/operator-binary/src/service.rs b/rust/operator-binary/src/service.rs index 8ba89ea0..c24548ca 100644 --- a/rust/operator-binary/src/service.rs +++ b/rust/operator-binary/src/service.rs @@ -8,9 +8,7 @@ use stackable_operator::{ role_utils::RoleGroupRef, }; -use crate::crd::{ - AirflowRole, HTTP_PORT, HTTP_PORT_NAME, METRICS_PORT, METRICS_PORT_NAME, v1alpha1, -}; +use crate::crd::{HTTP_PORT, HTTP_PORT_NAME, METRICS_PORT, METRICS_PORT_NAME, v1alpha1}; pub const METRICS_SERVICE_SUFFIX: &str = "metrics"; pub const HEADLESS_SERVICE_SUFFIX: &str = "headless"; @@ -111,16 +109,8 @@ pub fn build_rolegroup_metrics_service( } pub fn stateful_set_service_name( - _airflow_role: &AirflowRole, rolegroup_ref: &RoleGroupRef, ) -> Option { - //match airflow_role { - //AirflowRole::Webserver => Some(rolegroup_headless_service_name( - //&rolegroup_ref.object_name(), - //)), - - //AirflowRole::Scheduler | AirflowRole::Worker => None, - //} Some(rolegroup_headless_service_name( &rolegroup_ref.object_name(), ))