Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: openshift/cluster-version-operator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e7024636e04e87eea9250bb094a01d309f990ad3
Choose a base ref
..
head repository: openshift/cluster-version-operator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3218ea06e08107bf21711636b5afb3e3dbb566ff
Choose a head ref
Showing with 3 additions and 4 deletions.
  1. +3 −4 pkg/payload/precondition/clusterversion/upgradeable.go
7 changes: 3 additions & 4 deletions pkg/payload/precondition/clusterversion/upgradeable.go
Original file line number Diff line number Diff line change
@@ -96,7 +96,8 @@ func (pf *Upgradeable) Run(ctx context.Context, releaseContext precondition.Rele
}

klog.V(4).Infof("The current version is %s parsed from %s and the target version is %s parsed from %s", currentVersion.String(), cv.Status.Desired.Version, targetVersion.String(), releaseContext.DesiredVersion)
if targetVersion.LTE(currentVersion) || (targetVersion.Major == currentVersion.Major && targetVersion.Minor == currentVersion.Minor) {
patchOnly := targetVersion.Major == currentVersion.Major && targetVersion.Minor == currentVersion.Minor
if targetVersion.LTE(currentVersion) || patchOnly {
// When Upgradeable==False, a patch level update with the same minor level is allowed unless overrides are set
// This Upgradeable precondition is only concerned about moving forward, i.e., do not care about downgrade which is taken care of by the Rollback precondition
if condition := ClusterVersionOverridesCondition(cv); condition != nil {
@@ -107,9 +108,7 @@ func (pf *Upgradeable) Run(ctx context.Context, releaseContext precondition.Rele
Name: pf.Name(),
}
} else {
if completedVersion := minorUpdateFrom(cv.Status, currentVersion); completedVersion != "" &&
targetVersion.Major == currentVersion.Major &&
targetVersion.Minor == currentVersion.Minor {
if completedVersion := minorUpdateFrom(cv.Status, currentVersion); completedVersion != "" && patchOnly {
// This is to generate an accepted risk for the accepting case 4.y.z -> 4.y+1.z' -> 4.y+1.z''
return &precondition.Error{
Reason: "MinorVersionClusterUpgradeInProgress",