File tree Expand file tree Collapse file tree
internal/controllers/generic/status Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ func SetCommonConditions[T any](
4242) {
4343 availableCondition := applyconfigv1 .Condition ().
4444 WithType (orcv1alpha1 .ConditionAvailable ).
45- WithStatus (availableStatus ).
4645 WithObservedGeneration (orcObject .GetGeneration ())
4746 progressingCondition := applyconfigv1 .Condition ().
4847 WithType (orcv1alpha1 .ConditionProgressing ).
@@ -79,6 +78,18 @@ func SetCommonConditions[T any](
7978 }
8079 }
8180
81+ // When a terminal error is present, the resource is definitively unavailable.
82+ // Override Unknown → False so the Available condition reflects the severity.
83+ if availableStatus != metav1 .ConditionTrue {
84+ err := reconcileStatus .GetError ()
85+ var terminalError * orcerrors.TerminalError
86+ if errors .As (err , & terminalError ) {
87+ availableStatus = metav1 .ConditionFalse
88+ }
89+ }
90+
91+ availableCondition .WithStatus (availableStatus )
92+
8293 if availableStatus == metav1 .ConditionTrue {
8394 availableCondition .
8495 WithReason (orcv1alpha1 .ConditionReasonSuccess ).
You can’t perform that action at this time.
0 commit comments