Skip to content

Commit f007065

Browse files
committed
pkg: Update Upgradeable condition to explicitly mention major version updates (v2)
Additional locations caught by David and Claude's collaboration [1,2]. [1]: #1276 (comment) [2]: #1276 (comment)
1 parent d01b53a commit f007065

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

install/0000_90_cluster-version-operator_02_servicemonitor.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ spec:
8787
rules:
8888
- alert: ClusterNotUpgradeable
8989
annotations:
90-
summary: One or more cluster operators have been blocking minor version cluster upgrades for at least an hour.
90+
summary: One or more cluster operators have been blocking minor or major version cluster updates for at least an hour.
9191
description: In most cases, you will still be able to apply patch releases. Reason {{ "{{ with $cluster_operator_conditions := \"cluster_operator_conditions\" | query}}{{range $value := .}}{{if and (eq (label \"name\" $value) \"version\") (eq (label \"condition\" $value) \"Upgradeable\") (eq (label \"endpoint\" $value) \"metrics\") (eq (value $value) 0.0) (ne (len (label \"reason\" $value)) 0) }}{{label \"reason\" $value}}.{{end}}{{end}}{{end}}"}} For more information refer to 'oc adm upgrade'{{ "{{ with $console_url := \"console_url\" | query }}{{ if ne (len (label \"url\" (first $console_url ) ) ) 0}} or {{ label \"url\" (first $console_url ) }}/settings/cluster/{{ end }}{{ end }}" }}.
9292
expr: |
9393
max by (namespace, name, condition, endpoint) (cluster_operator_conditions{name="version", condition="Upgradeable", endpoint="metrics"} == 0)

pkg/internal/constants.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ const (
5656
ImplicitlyEnabledCapabilities configv1.ClusterStatusConditionType = "ImplicitlyEnabledCapabilities"
5757

5858
// UpgradeableAdminAckRequired is False if there is API removed from the Kubernetes API server which requires admin
59-
// consideration, and thus update to the next minor version is blocked.
59+
// consideration, and thus update to the next minor or major version is blocked.
6060
UpgradeableAdminAckRequired configv1.ClusterStatusConditionType = "UpgradeableAdminAckRequired"
61-
// UpgradeableDeletesInProgress is False if deleting resources is in progress, and thus update to the next minor
61+
// UpgradeableDeletesInProgress is False if deleting resources is in progress, and thus update to the next minor or major
6262
// version is blocked.
6363
UpgradeableDeletesInProgress configv1.ClusterStatusConditionType = "UpgradeableDeletesInProgress"
64-
// UpgradeableClusterOperators is False if something is wrong with Cluster Operators, and thus update to the next minor
64+
// UpgradeableClusterOperators is False if something is wrong with Cluster Operators, and thus update to the next minor or major
6565
// version is blocked.
6666
UpgradeableClusterOperators configv1.ClusterStatusConditionType = "UpgradeableClusterOperators"
67-
// UpgradeableClusterVersionOverrides is False if there are overrides in the Cluster Version, and thus update to the next minor
67+
// UpgradeableClusterVersionOverrides is False if there are overrides in the Cluster Version, and thus update to the next minor or major
6868
// version is blocked.
6969
UpgradeableClusterVersionOverrides configv1.ClusterStatusConditionType = "UpgradeableClusterVersionOverrides"
7070

71-
// UpgradeableUpgradeInProgress is True if an update is in progress
71+
// UpgradeableUpgradeInProgress is True if an update is in progress.
7272
UpgradeableUpgradeInProgress configv1.ClusterStatusConditionType = "UpgradeableUpgradeInProgress"
7373
)

pkg/payload/precondition/clusterversion/upgradeable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func (pf *Upgradeable) Run(ctx context.Context, releaseContext precondition.Rele
9898
patchOnly := targetVersion.Major == currentVersion.Major && targetVersion.Minor == currentVersion.Minor
9999
if targetVersion.LTE(currentVersion) || patchOnly {
100100
// When Upgradeable==False, a patch level update with the same minor version is allowed unless overrides are set.
101-
// However, minor or major version updates are blocked when Upgradeable==False (handled below at line 124).
101+
// However, minor or major version updates are blocked when Upgradeable==False.
102102
// 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
103103
if condition := ClusterVersionOverridesCondition(cv); condition != nil {
104104
klog.V(2).Infof("Retarget from %s to %s is blocked by %s: %s", currentVersion.String(), targetVersion.String(), condition.Reason, condition.Message)

0 commit comments

Comments
 (0)