@@ -303,8 +303,9 @@ pub async fn reconcile_trino(
303303 . context ( DereferenceSnafu ) ?;
304304
305305 // validate (no client required)
306- let validated = validate:: validate ( trino, & dereferenced_objects, & ctx. operator_environment )
307- . context ( ValidateClusterSnafu ) ?;
306+ let validated_cluster =
307+ validate:: validate ( trino, & dereferenced_objects, & ctx. operator_environment )
308+ . context ( ValidateClusterSnafu ) ?;
308309
309310 let mut cluster_resources = ClusterResources :: new (
310311 APP_NAME ,
@@ -359,14 +360,14 @@ pub async fn reconcile_trino(
359360
360361 let mut sts_cond_builder = StatefulSetConditionBuilder :: default ( ) ;
361362
362- for ( trino_role, role_group_configs) in & validated . role_group_configs {
363+ for ( trino_role, role_group_configs) in & validated_cluster . role_group_configs {
363364 for ( role_group_name, rg) in role_group_configs {
364365 let role_group_ref = trino_role. rolegroup_ref ( trino, role_group_name) ;
365366 let merged_config = & rg. config ;
366367
367368 let role_group_service_recommended_labels = build_recommended_labels (
368369 trino,
369- & validated . image . app_version_label_value ,
370+ & validated_cluster . image . app_version_label_value ,
370371 & role_group_ref. role ,
371372 & role_group_ref. role_group ,
372373 ) ;
@@ -396,7 +397,7 @@ pub async fn reconcile_trino(
396397 . context ( ServiceConfigurationSnafu ) ?;
397398
398399 let rg_configmap = build:: config_map:: build_rolegroup_config_map (
399- & validated ,
400+ & validated_cluster ,
400401 trino_role,
401402 & role_group_ref,
402403 & client. kubernetes_cluster_info ,
@@ -409,24 +410,24 @@ pub async fn reconcile_trino(
409410
410411 let rg_catalog_configmap = build_rolegroup_catalog_config_map (
411412 trino,
412- & validated . image ,
413+ & validated_cluster . image ,
413414 & role_group_ref,
414- & validated . cluster_config . catalogs ,
415+ & validated_cluster . cluster_config . catalogs ,
415416 ) ?;
416417
417418 let rg_stateful_set = build_rolegroup_statefulset (
418419 trino,
419420 trino_role,
420- & validated . image ,
421+ & validated_cluster . image ,
421422 & role_group_ref,
422423 & rg. env_overrides ,
423424 merged_config,
424- & validated . cluster_config . authentication ,
425- & validated . cluster_config . catalogs ,
425+ & validated_cluster . cluster_config . authentication ,
426+ & validated_cluster . cluster_config . catalogs ,
426427 & rbac_sa. name_any ( ) ,
427- & validated . cluster_config . fault_tolerant_execution ,
428- & validated . cluster_config . client_protocol ,
429- & validated . cluster_config . authorization ,
428+ & validated_cluster . cluster_config . fault_tolerant_execution ,
429+ & validated_cluster . cluster_config . client_protocol ,
430+ & validated_cluster . cluster_config . authorization ,
430431 ) ?;
431432
432433 cluster_resources
@@ -476,7 +477,7 @@ pub async fn reconcile_trino(
476477 trino,
477478 build_recommended_labels (
478479 trino,
479- & validated . image . app_version_label_value ,
480+ & validated_cluster . image . app_version_label_value ,
480481 & trino_role. to_string ( ) ,
481482 "none" ,
482483 ) ,
@@ -1402,7 +1403,7 @@ mod tests {
14021403 image_repository : "oci.example.org" . to_string ( ) ,
14031404 } ;
14041405
1405- let validated =
1406+ let validated_cluster =
14061407 validate:: validate ( & trino, & derefs, & operator_env) . expect ( "validate should succeed" ) ;
14071408
14081409 let trino_role = TrinoRole :: Coordinator ;
@@ -1413,13 +1414,13 @@ mod tests {
14131414 } ;
14141415 let recommended_labels = build_recommended_labels (
14151416 & trino,
1416- & validated . image . app_version_label_value ,
1417+ & validated_cluster . image . app_version_label_value ,
14171418 & rolegroup_ref. role ,
14181419 & rolegroup_ref. role_group ,
14191420 ) ;
14201421
14211422 build:: config_map:: build_rolegroup_config_map (
1422- & validated ,
1423+ & validated_cluster ,
14231424 & trino_role,
14241425 & rolegroup_ref,
14251426 & cluster_info,
@@ -1640,10 +1641,11 @@ mod tests {
16401641 operator_service_name : "trino-operator" . to_string ( ) ,
16411642 image_repository : "oci.example.org" . to_string ( ) ,
16421643 } ;
1643- let validated =
1644+ let validated_cluster =
16441645 validate:: validate ( & trino, & derefs, & operator_env) . expect ( "validate should succeed" ) ;
16451646
1646- let env = & validated. role_group_configs [ & TrinoRole :: Coordinator ] [ "default" ] . env_overrides ;
1647+ let env =
1648+ & validated_cluster. role_group_configs [ & TrinoRole :: Coordinator ] [ "default" ] . env_overrides ;
16471649 let value = |name : & str | env. get ( name) . cloned ( ) ;
16481650 assert_eq ! ( value( "COMMON_VAR" ) . as_deref( ) , Some ( "group-value" ) ) ;
16491651 assert_eq ! ( value( "GROUP_VAR" ) . as_deref( ) , Some ( "group-value" ) ) ;
0 commit comments