@@ -165,20 +165,16 @@ func (c *Controller) updateOperatorStatus(ctx context.Context, previousStatus *o
165165 }
166166
167167 deploymentAvailableCondition := applyoperatorv1 .OperatorCondition ().
168- WithType (fmt .Sprintf ("%sDeployment%s" , c .conditionsPrefix , operatorv1 .OperatorStatusTypeAvailable )).
169- WithStatus (operatorv1 .ConditionTrue )
168+ WithType (fmt .Sprintf ("%sDeployment%s" , c .conditionsPrefix , operatorv1 .OperatorStatusTypeAvailable ))
170169
171170 workloadDegradedCondition := applyoperatorv1 .OperatorCondition ().
172- WithType (fmt .Sprintf ("%sWorkloadDegraded" , c .conditionsPrefix )).
173- WithStatus (operatorv1 .ConditionFalse )
171+ WithType (fmt .Sprintf ("%sWorkloadDegraded" , c .conditionsPrefix ))
174172
175173 deploymentDegradedCondition := applyoperatorv1 .OperatorCondition ().
176- WithType (fmt .Sprintf ("%sDeploymentDegraded" , c .conditionsPrefix )).
177- WithStatus (operatorv1 .ConditionFalse )
174+ WithType (fmt .Sprintf ("%sDeploymentDegraded" , c .conditionsPrefix ))
178175
179176 deploymentProgressingCondition := applyoperatorv1 .OperatorCondition ().
180- WithType (fmt .Sprintf ("%sDeployment%s" , c .conditionsPrefix , operatorv1 .OperatorStatusTypeProgressing )).
181- WithStatus (operatorv1 .ConditionFalse )
177+ WithType (fmt .Sprintf ("%sDeployment%s" , c .conditionsPrefix , operatorv1 .OperatorStatusTypeProgressing ))
182178
183179 status := applyoperatorv1 .OperatorStatus ()
184180 defer func () {
@@ -218,6 +214,11 @@ func (c *Controller) updateOperatorStatus(ctx context.Context, previousStatus *o
218214 WithStatus (operatorv1 .ConditionFalse ).
219215 WithReason ("PreconditionNotFulfilled" )
220216
217+ workloadDegradedCondition = workloadDegradedCondition .
218+ WithStatus (operatorv1 .ConditionTrue ).
219+ WithReason ("PreconditionNotFulfilled" ).
220+ WithMessage (message )
221+
221222 return kerrors .NewAggregate (errs )
222223 }
223224
@@ -252,6 +253,11 @@ func (c *Controller) updateOperatorStatus(ctx context.Context, previousStatus *o
252253 WithReason ("NoDeployment" ).
253254 WithMessage (message )
254255
256+ workloadDegradedCondition = workloadDegradedCondition .
257+ WithStatus (operatorv1 .ConditionTrue ).
258+ WithReason ("NoDeployment" ).
259+ WithMessage (message )
260+
255261 return kerrors .NewAggregate (errs )
256262 }
257263
0 commit comments