@@ -16,19 +16,16 @@ use stackable_operator::{
1616 } ,
1717 logging:: controller:: ReconcilerError ,
1818 shared:: time:: Duration ,
19- status:: condition:: {
20- compute_conditions, operations:: ClusterOperationsConditionBuilder ,
21- statefulset:: StatefulSetConditionBuilder ,
22- } ,
2319} ;
2420use strum:: { EnumDiscriminants , IntoStaticStr } ;
2521
2622use crate :: {
2723 controller:: {
2824 apply:: { self , Applier , ensure_random_secrets} ,
2925 build,
26+ update_status:: { self , update_status} ,
3027 } ,
31- crd:: { AirflowClusterStatus , OPERATOR_NAME , v1alpha2} ,
28+ crd:: { OPERATOR_NAME , v1alpha2} ,
3229} ;
3330
3431pub const AIRFLOW_CONTROLLER_NAME : & str = "airflowcluster" ;
@@ -55,10 +52,8 @@ pub enum Error {
5552 #[ snafu( display( "failed to ensure the shared random Secrets exist" ) ) ]
5653 EnsureSecrets { source : apply:: Error } ,
5754
58- #[ snafu( display( "failed to update status" ) ) ]
59- ApplyStatus {
60- source : stackable_operator:: client:: Error ,
61- } ,
55+ #[ snafu( display( "failed to update the cluster status" ) ) ]
56+ UpdateStatus { source : update_status:: Error } ,
6257
6358 #[ snafu( display( "failed to dereference cluster resources" ) ) ]
6459 Dereference {
@@ -102,9 +97,6 @@ pub async fn reconcile_airflow(
10297 . await
10398 . context ( DereferenceSnafu ) ?;
10499
105- let cluster_operation_cond_builder =
106- ClusterOperationsConditionBuilder :: new ( & airflow. spec . cluster_operation ) ;
107-
108100 let validated_cluster = crate :: controller:: validate:: validate_cluster (
109101 airflow,
110102 & ctx. operator_environment . image_repository ,
@@ -127,22 +119,9 @@ pub async fn reconcile_airflow(
127119 . await
128120 . context ( ApplyResourcesSnafu ) ?;
129121
130- let mut ss_cond_builder = StatefulSetConditionBuilder :: default ( ) ;
131- for statefulset in applied. stateful_sets {
132- ss_cond_builder. add ( statefulset) ;
133- }
134-
135- let status = AirflowClusterStatus {
136- conditions : compute_conditions (
137- airflow,
138- & [ & ss_cond_builder, & cluster_operation_cond_builder] ,
139- ) ,
140- } ;
141-
142- client
143- . apply_patch_status ( OPERATOR_NAME , airflow, & status)
122+ update_status ( client, airflow, & applied)
144123 . await
145- . context ( ApplyStatusSnafu ) ?;
124+ . context ( UpdateStatusSnafu ) ?;
146125
147126 Ok ( Action :: await_change ( ) )
148127}
0 commit comments