Skip to content

Commit 9b7b338

Browse files
committed
pkg/internal/constants: Deprecate Upgradeable* subcondition constants
We only use these in RemoveOperatorStatusCondition calls since ea13ba6 (pkg: Use risk.Source framework to feed Upgradeable, 2026-04-05, #1368). Mark them as deprecated with expected removals in the 5.1 dev cycle, to reduce the odds that other folks start consuming them now. That's unlikely, because they're in pkg/internal, but it's easy to add the standard deprecation Godocs [1]. The nolint directives avoid [2]: pkg/cvo/status.go:641:68: SA1019: internal.UpgradeableAdminAckRequired is deprecated: In 5.0, we stopped populating Upgradeable* subconditions, and now populate Upgradeable directly. The constants remain so we can remove them from 5.0 ClusterVersion status, but we will remove the constants themselves in 5.1. (staticcheck) resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableAdminAckRequired) ^ and similar. [1]: https://go.dev/wiki/Deprecated [2]: https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_cluster-version-operator/1391/pull-ci-openshift-cluster-version-operator-main-lint/2056884282562973696#1:build-log.txt%3A28
1 parent 7764ea6 commit 9b7b338

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

pkg/cvo/status.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -638,11 +638,11 @@ func setUpgradeableCondition(ctx context.Context, cvStatus *configv1.ClusterVers
638638
}
639639

640640
// remove obsolete subconditions
641-
resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableAdminAckRequired)
642-
resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableDeletesInProgress)
643-
resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableClusterOperators)
644-
resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableClusterVersionOverrides)
645-
resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableUpgradeInProgress)
641+
resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableAdminAckRequired) //nolint:staticcheck // Ignore SA1019 until 5.1
642+
resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableDeletesInProgress) //nolint:staticcheck // Ignore SA1019 until 5.1
643+
resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableClusterOperators) //nolint:staticcheck // Ignore SA1019 until 5.1
644+
resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableClusterVersionOverrides) //nolint:staticcheck // Ignore SA1019 until 5.1
645+
resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableUpgradeInProgress) //nolint:staticcheck // Ignore SA1019 until 5.1
646646

647647
if len(risks) == 0 {
648648
if err != nil {

pkg/internal/constants.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,33 @@ const (
7070

7171
// UpgradeableAdminAckRequired is False if there is API removed from the Kubernetes API server which requires admin
7272
// consideration, and thus update to the next minor or major version is blocked.
73+
//
74+
// Deprecated: In 5.0, we stopped populating Upgradeable* subconditions, and now populate Upgradeable directly.
75+
// The constants remain so we can remove them from 5.0 ClusterVersion status, but we will remove the constants themselves in 5.1.
7376
UpgradeableAdminAckRequired configv1.ClusterStatusConditionType = "UpgradeableAdminAckRequired"
7477
// UpgradeableDeletesInProgress is False if deleting resources is in progress, and thus update to the next minor or major
7578
// version is blocked.
79+
//
80+
// Deprecated: In 5.0, we stopped populating Upgradeable* subconditions, and now populate Upgradeable directly.
81+
// The constants remain so we can remove them from 5.0 ClusterVersion status, but we will remove the constants themselves in 5.1.
7682
UpgradeableDeletesInProgress configv1.ClusterStatusConditionType = "UpgradeableDeletesInProgress"
7783
// UpgradeableClusterOperators is False if something is wrong with Cluster Operators, and thus update to the next minor or major
7884
// version is blocked.
85+
//
86+
// Deprecated: In 5.0, we stopped populating Upgradeable* subconditions, and now populate Upgradeable directly.
87+
// The constants remain so we can remove them from 5.0 ClusterVersion status, but we will remove the constants themselves in 5.1.
7988
UpgradeableClusterOperators configv1.ClusterStatusConditionType = "UpgradeableClusterOperators"
8089
// UpgradeableClusterVersionOverrides is False if there are overrides in the Cluster Version, and thus update to the next minor or major
8190
// version is blocked.
91+
//
92+
// Deprecated: In 5.0, we stopped populating Upgradeable* subconditions, and now populate Upgradeable directly.
93+
// The constants remain so we can remove them from 5.0 ClusterVersion status, but we will remove the constants themselves in 5.1.
8294
UpgradeableClusterVersionOverrides configv1.ClusterStatusConditionType = "UpgradeableClusterVersionOverrides"
8395

8496
// UpgradeableUpgradeInProgress is True if an update is in progress.
97+
//
98+
// Deprecated: In 5.0, we stopped populating Upgradeable* subconditions, and now populate Upgradeable directly.
99+
// The constants remain so we can remove them from 5.0 ClusterVersion status, but we will remove the constants themselves in 5.1.
85100
UpgradeableUpgradeInProgress configv1.ClusterStatusConditionType = "UpgradeableUpgradeInProgress"
86101

87102
// ConditionalUpdateConditionTypeRecommended is a type of the condition present on a conditional update

0 commit comments

Comments
 (0)