@@ -67,7 +67,7 @@ use stackable_operator::{
6767use strum:: { EnumDiscriminants , IntoStaticStr } ;
6868
6969use crate :: {
70- controller:: build:: config_map,
70+ controller:: { build:: config_map, validate :: ValidatedAirflowCluster } ,
7171 controller_commons:: { self , CONFIG_VOLUME_NAME , LOG_CONFIG_VOLUME_NAME , LOG_VOLUME_NAME } ,
7272 crd:: {
7373 self , APP_NAME , AirflowClusterStatus , AirflowConfig , AirflowExecutor ,
@@ -344,7 +344,7 @@ pub async fn reconcile_airflow(
344344 None
345345 } ;
346346
347- let validated = crate :: controller:: validate:: validate_cluster (
347+ let validated_cluster = crate :: controller:: validate:: validate_cluster (
348348 airflow,
349349 & ctx. operator_environment . image_repository ,
350350 dereferenced,
@@ -418,26 +418,24 @@ pub async fn reconcile_airflow(
418418 // collection there will be a pod template created to be used for pod provisioning
419419 if let AirflowExecutor :: KubernetesExecutors {
420420 common_configuration,
421- } = & validated . executor
421+ } = & validated_cluster . executor
422422 {
423423 build_executor_template (
424424 airflow,
425425 common_configuration,
426426 & metadata_database_connection_details,
427- & validated. image ,
428- & validated. authentication_config ,
429- & validated. authorization_config ,
427+ & validated_cluster,
430428 & mut cluster_resources,
431429 client,
432430 & rbac_sa,
433431 )
434432 . await ?;
435433 }
436434
437- for ( airflow_role, role_group_configs) in & validated . role_groups {
435+ for ( airflow_role, role_group_configs) in & validated_cluster . role_groups {
438436 let role_name = airflow_role. to_string ( ) ;
439437
440- if let Some ( role_config) = validated . role_configs . get ( airflow_role) {
438+ if let Some ( role_config) = validated_cluster . role_configs . get ( airflow_role) {
441439 if let Some ( pdb) = & role_config. pdb {
442440 add_pdbs ( pdb, airflow, airflow_role, client, & mut cluster_resources)
443441 . await
@@ -451,7 +449,7 @@ pub async fn reconcile_airflow(
451449 build_recommended_labels (
452450 airflow,
453451 AIRFLOW_CONTROLLER_NAME ,
454- & validated . image . app_version_label_value ,
452+ & validated_cluster . image . app_version_label_value ,
455453 & role_name,
456454 "none" ,
457455 ) ,
@@ -475,7 +473,7 @@ pub async fn reconcile_airflow(
475473
476474 let git_sync_resources = git_sync:: v1alpha2:: GitSyncResources :: new (
477475 & airflow. spec . cluster_config . dags_git_sync ,
478- & validated . image ,
476+ & validated_cluster . image ,
479477 & validated_rg_config
480478 . overrides
481479 . env_overrides
@@ -498,7 +496,7 @@ pub async fn reconcile_airflow(
498496 let role_group_service_recommended_labels = build_recommended_labels (
499497 airflow,
500498 AIRFLOW_CONTROLLER_NAME ,
501- & validated . image . app_version_label_value ,
499+ & validated_cluster . image . app_version_label_value ,
502500 & rolegroup. role ,
503501 & rolegroup. role_group ,
504502 ) ;
@@ -542,11 +540,9 @@ pub async fn reconcile_airflow(
542540
543541 let rg_configmap = config_map:: build_rolegroup_config_map (
544542 airflow,
545- & validated . image ,
543+ & validated_cluster ,
546544 & rolegroup,
547545 & validated_rg_config. overrides . config_file_overrides ,
548- & validated. authentication_config ,
549- & validated. authorization_config ,
550546 & validated_rg_config. merged_config . logging ,
551547 & Container :: Airflow ,
552548 )
@@ -560,17 +556,17 @@ pub async fn reconcile_airflow(
560556
561557 let rg_statefulset = build_server_rolegroup_statefulset (
562558 airflow,
563- & validated . image ,
559+ & validated_cluster . image ,
564560 airflow_role,
565561 & rolegroup,
566562 & validated_rg_config. overrides . env_overrides ,
567- & validated . authentication_config ,
568- & validated . authorization_config ,
563+ & validated_cluster . authentication_config ,
564+ & validated_cluster . authorization_config ,
569565 & metadata_database_connection_details,
570566 & celery_database_connection_details,
571567 & rbac_sa,
572568 & validated_rg_config. merged_config ,
573- & validated . executor ,
569+ & validated_cluster . executor ,
574570 & git_sync_resources,
575571 ) ?;
576572
@@ -610,9 +606,7 @@ async fn build_executor_template(
610606 airflow : & v1alpha2:: AirflowCluster ,
611607 common_config : & AirflowExecutorCommonConfiguration ,
612608 metadata_database_connection_details : & SqlAlchemyDatabaseConnectionDetails ,
613- resolved_product_image : & ResolvedProductImage ,
614- authentication_config : & AirflowClientAuthenticationDetailsResolved ,
615- authorization_config : & AirflowAuthorizationResolved ,
609+ validated_cluster : & ValidatedAirflowCluster ,
616610 cluster_resources : & mut ClusterResources < ' _ > ,
617611 client : & stackable_operator:: client:: Client ,
618612 rbac_sa : & stackable_operator:: k8s_openapi:: api:: core:: v1:: ServiceAccount ,
@@ -628,11 +622,9 @@ async fn build_executor_template(
628622
629623 let rg_configmap = config_map:: build_rolegroup_config_map (
630624 airflow,
631- resolved_product_image ,
625+ validated_cluster ,
632626 & rolegroup,
633627 & BTreeMap :: new ( ) ,
634- authentication_config,
635- authorization_config,
636628 & merged_executor_config. logging ,
637629 & Container :: Base ,
638630 )
@@ -646,7 +638,7 @@ async fn build_executor_template(
646638
647639 let git_sync_resources = git_sync:: v1alpha2:: GitSyncResources :: new (
648640 & airflow. spec . cluster_config . dags_git_sync ,
649- resolved_product_image ,
641+ & validated_cluster . image ,
650642 & common_config
651643 . env_overrides
652644 . iter ( )
@@ -666,8 +658,8 @@ async fn build_executor_template(
666658
667659 let worker_pod_template_config_map = build_executor_template_config_map (
668660 airflow,
669- resolved_product_image ,
670- authentication_config,
661+ & validated_cluster . image ,
662+ & validated_cluster . authentication_config ,
671663 metadata_database_connection_details,
672664 & rbac_sa. name_unchecked ( ) ,
673665 & merged_executor_config,
0 commit comments