From 7f4dcb7c66d40a391283019ce377bb5f35d8a69c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 19 May 2026 16:42:22 -0700 Subject: [PATCH] pkg/internal/constants: Deprecate Upgradeable* subcondition constants We only use these in RemoveOperatorStatusCondition calls since ea13ba6118 (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 --- pkg/cvo/status.go | 10 +++++----- pkg/internal/constants.go | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/pkg/cvo/status.go b/pkg/cvo/status.go index 46163f5102..aa1bc17ed1 100644 --- a/pkg/cvo/status.go +++ b/pkg/cvo/status.go @@ -638,11 +638,11 @@ func setUpgradeableCondition(ctx context.Context, cvStatus *configv1.ClusterVers } // remove obsolete subconditions - resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableAdminAckRequired) - resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableDeletesInProgress) - resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableClusterOperators) - resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableClusterVersionOverrides) - resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableUpgradeInProgress) + resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableAdminAckRequired) //nolint:staticcheck // Ignore SA1019 until 5.1 + resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableDeletesInProgress) //nolint:staticcheck // Ignore SA1019 until 5.1 + resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableClusterOperators) //nolint:staticcheck // Ignore SA1019 until 5.1 + resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableClusterVersionOverrides) //nolint:staticcheck // Ignore SA1019 until 5.1 + resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableUpgradeInProgress) //nolint:staticcheck // Ignore SA1019 until 5.1 if len(risks) == 0 { if err != nil { diff --git a/pkg/internal/constants.go b/pkg/internal/constants.go index eac0f36af3..f926c504cc 100644 --- a/pkg/internal/constants.go +++ b/pkg/internal/constants.go @@ -70,18 +70,33 @@ const ( // UpgradeableAdminAckRequired is False if there is API removed from the Kubernetes API server which requires admin // consideration, and thus update to the next minor or major version is blocked. + // + // 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. UpgradeableAdminAckRequired configv1.ClusterStatusConditionType = "UpgradeableAdminAckRequired" // UpgradeableDeletesInProgress is False if deleting resources is in progress, and thus update to the next minor or major // version is blocked. + // + // 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. UpgradeableDeletesInProgress configv1.ClusterStatusConditionType = "UpgradeableDeletesInProgress" // UpgradeableClusterOperators is False if something is wrong with Cluster Operators, and thus update to the next minor or major // version is blocked. + // + // 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. UpgradeableClusterOperators configv1.ClusterStatusConditionType = "UpgradeableClusterOperators" // UpgradeableClusterVersionOverrides is False if there are overrides in the Cluster Version, and thus update to the next minor or major // version is blocked. + // + // 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. UpgradeableClusterVersionOverrides configv1.ClusterStatusConditionType = "UpgradeableClusterVersionOverrides" // UpgradeableUpgradeInProgress is True if an update is in progress. + // + // 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. UpgradeableUpgradeInProgress configv1.ClusterStatusConditionType = "UpgradeableUpgradeInProgress" // ConditionalUpdateConditionTypeRecommended is a type of the condition present on a conditional update