Skip to content

Commit 4b46183

Browse files
author
Per Goncalves da Silva
committed
add replacement check in csv pending phase
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent 578ad82 commit 4b46183

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/controller/operators/olm/operator.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,6 +2110,12 @@ func (a *Operator) transitionCSVState(in v1alpha1.ClusterServiceVersion) (out *v
21102110
logger.Info("scheduling ClusterServiceVersion for requirement verification")
21112111
out.SetPhaseWithEvent(v1alpha1.CSVPhasePending, v1alpha1.CSVReasonRequirementsUnknown, "requirements not yet checked", now, a.recorder)
21122112
case v1alpha1.CSVPhasePending:
2113+
// Check if the current CSV is being replaced, return with replacing status if so
2114+
if err := a.checkReplacementsAndUpdateStatus(out); err != nil {
2115+
logger.WithError(err).Info("replacement check")
2116+
return
2117+
}
2118+
21132119
// Check previous version's Upgradeable condition
21142120
replacedCSV := a.isReplacing(out)
21152121
if replacedCSV != nil {

0 commit comments

Comments
 (0)