Skip to content

Commit 5072ca0

Browse files
Forgeeshulman2
authored andcommitted
[AISOS-376] fix: address CI failures (attempt 3)
1 parent 3ebabf9 commit 5072ca0

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

internal/controllers/generic/status/conditions.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff 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).

0 commit comments

Comments
 (0)