Skip to content

Commit 566bef7

Browse files
author
Per Goncalves da Silva
committed
Patch boxcutter steps to rewrite Progressing cond. to follow original contract
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent 53de030 commit 566bef7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

internal/operator-controller/controllers/boxcutter_reconcile_steps.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,23 @@ func ApplyBundleWithBoxcutter(a Applier) ReconcileStepFunc {
153153
ext.Status.ActiveRevisions = append(ext.Status.ActiveRevisions, rs)
154154
}
155155
}
156+
157+
// Rewrite Progressing condition to respect the existing contract
158+
// Currently ClusterExtension treats the Progressing condition in the same way as the Deployment resource
159+
// It signals there's nothing in the way of the resource progressing rather than the resource is undergoing
160+
// active reconciliation at the moment. In order to not break the original contract, we rewrite the condition.
161+
// This should be temporary until we understand whether we can change how the Progressing condition operates.
162+
if cnd := apimeta.FindStatusCondition(ext.Status.Conditions, ocv1.ClusterExtensionRevisionTypeProgressing); cnd != nil {
163+
if cnd.Status == metav1.ConditionFalse && cnd.Reason == ocv1.ClusterExtensionRevisionReasonRolledOut {
164+
cnd.Status = metav1.ConditionTrue
165+
cnd.Reason = ocv1.ReasonSucceeded
166+
apimeta.SetStatusCondition(&ext.Status.Conditions, *cnd)
167+
}
168+
if cnd.Reason == ocv1.ClusterExtensionRevisionReasonRolloutError {
169+
cnd.Reason = ocv1.ReasonRetrying
170+
}
171+
}
172+
setInstalledStatusFromRevisionStates(ext, revisionStates)
156173
return ctx, nil, nil
157174
}
158175
}

0 commit comments

Comments
 (0)