@@ -67,18 +67,19 @@ use stackable_operator::{
6767use strum:: { EnumDiscriminants , IntoStaticStr } ;
6868
6969use crate :: {
70- controller:: { build:: config_map, validate:: ValidatedAirflowCluster } ,
70+ controller:: {
71+ build:: config_map,
72+ validate:: { ValidatedAirflowCluster , ValidatedRoleGroupConfig } ,
73+ } ,
7174 controller_commons:: { self , CONFIG_VOLUME_NAME , LOG_CONFIG_VOLUME_NAME , LOG_VOLUME_NAME } ,
7275 crd:: {
73- self , APP_NAME , AirflowClusterStatus , AirflowConfig , AirflowExecutor ,
74- AirflowExecutorCommonConfiguration , AirflowRole , CONFIG_PATH , Container , ExecutorConfig ,
75- HTTP_PORT , HTTP_PORT_NAME , LISTENER_VOLUME_DIR , LISTENER_VOLUME_NAME , LOG_CONFIG_DIR ,
76- METRICS_PORT , METRICS_PORT_NAME , OPERATOR_NAME , STACKABLE_LOG_DIR , TEMPLATE_LOCATION ,
77- TEMPLATE_NAME , TEMPLATE_VOLUME_NAME ,
76+ self , APP_NAME , AirflowClusterStatus , AirflowExecutor , AirflowExecutorCommonConfiguration ,
77+ AirflowRole , CONFIG_PATH , Container , ExecutorConfig , HTTP_PORT , HTTP_PORT_NAME ,
78+ LISTENER_VOLUME_DIR , LISTENER_VOLUME_NAME , LOG_CONFIG_DIR , METRICS_PORT , METRICS_PORT_NAME ,
79+ OPERATOR_NAME , STACKABLE_LOG_DIR , TEMPLATE_LOCATION , TEMPLATE_NAME , TEMPLATE_VOLUME_NAME ,
7880 authentication:: {
7981 AirflowAuthenticationClassResolved , AirflowClientAuthenticationDetailsResolved ,
8082 } ,
81- authorization:: AirflowAuthorizationResolved ,
8283 build_recommended_labels,
8384 internal_secret:: {
8485 FERNET_KEY_SECRET_KEY , INTERNAL_SECRET_SECRET_KEY , JWT_SECRET_SECRET_KEY ,
@@ -556,17 +557,13 @@ pub async fn reconcile_airflow(
556557
557558 let rg_statefulset = build_server_rolegroup_statefulset (
558559 airflow,
559- & validated_cluster. image ,
560+ & validated_cluster,
560561 airflow_role,
561562 & rolegroup,
562- & validated_rg_config. overrides . env_overrides ,
563- & validated_cluster. authentication_config ,
564- & validated_cluster. authorization_config ,
563+ validated_rg_config,
565564 & metadata_database_connection_details,
566565 & celery_database_connection_details,
567566 & rbac_sa,
568- & validated_rg_config. merged_config ,
569- & validated_cluster. executor ,
570567 & git_sync_resources,
571568 ) ?;
572569
@@ -601,7 +598,6 @@ pub async fn reconcile_airflow(
601598 Ok ( Action :: await_change ( ) )
602599}
603600
604- #[ allow( clippy:: too_many_arguments) ]
605601async fn build_executor_template (
606602 airflow : & v1alpha2:: AirflowCluster ,
607603 common_config : & AirflowExecutorCommonConfiguration ,
@@ -738,22 +734,26 @@ fn listener_ports() -> Vec<listener::v1alpha1::ListenerPort> {
738734#[ allow( clippy:: too_many_arguments) ]
739735fn build_server_rolegroup_statefulset (
740736 airflow : & v1alpha2:: AirflowCluster ,
741- resolved_product_image : & ResolvedProductImage ,
737+ validated_cluster : & ValidatedAirflowCluster ,
742738 airflow_role : & AirflowRole ,
743739 rolegroup_ref : & RoleGroupRef < v1alpha2:: AirflowCluster > ,
744- env_overrides : & HashMap < String , String > ,
745- authentication_config : & AirflowClientAuthenticationDetailsResolved ,
746- authorization_config : & AirflowAuthorizationResolved ,
740+ validated_rg_config : & ValidatedRoleGroupConfig ,
747741 metadata_database_connection_details : & SqlAlchemyDatabaseConnectionDetails ,
748742 celery_database_connection_details : & Option < (
749743 CeleryDatabaseConnectionDetails ,
750744 CeleryDatabaseConnectionDetails ,
751745 ) > ,
752746 service_account : & ServiceAccount ,
753- merged_airflow_config : & AirflowConfig ,
754- executor : & AirflowExecutor ,
755747 git_sync_resources : & git_sync:: v1alpha2:: GitSyncResources ,
756748) -> Result < StatefulSet > {
749+ let merged_airflow_config = & validated_rg_config. merged_config ;
750+ let env_overrides = & validated_rg_config. overrides . env_overrides ;
751+
752+ let resolved_product_image = & validated_cluster. image ;
753+ let authentication_config = & validated_cluster. authentication_config ;
754+ let authorization_config = & validated_cluster. authorization_config ;
755+ let executor = & validated_cluster. executor ;
756+
757757 let binding = airflow. get_role ( airflow_role) ;
758758 let role = binding. as_ref ( ) . context ( NoAirflowRoleSnafu ) ?;
759759
0 commit comments