Skip to content

Commit 0eb5bef

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 5c79422 commit 0eb5bef

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

0 commit comments

Comments
 (0)