Repository navigation
⚠ Scope condition type and reason constants per API - #3205
Merged
openshift-merge-bot[bot] merged 1 commit intoNov 24, 2026
Merged
openshift-merge-bot[bot] merged 1 commit into
openshift-merge-bot[bot] merged 1 commit into
Conversation
Rename the unscoped condition type and reason constants to kind-scoped names (ClusterExtensionType*/ClusterExtensionReason*, ClusterCatalogType*/ClusterCatalogReason*) so it is immediately clear which API each constant belongs to and cross-API misuse is easy to spot: - ClusterExtension constants formerly spread across common_types.go and clusterextension_types.go now live in clusterextension_types.go; common_types.go is removed. - ClusterCatalog gains its own Progressing-condition constants (ClusterCatalogTypeProgressing, ClusterCatalogReasonSucceeded, Retrying, Blocked), which catalogd previously borrowed from ClusterExtension. - ClusterObjectDeploymentReasonProgressDeadlineExceeded is defined directly instead of aliasing the shared constant. Constant values are unchanged; only Go identifiers change. This is a breaking change for Go consumers of the removed unscoped constants. Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
👷 Deploy request for olmv1 pending review.Visit the deploys page to approve it
|
perdasilva
pushed a commit
to perdasilva/operator-controller
that referenced
this pull request
Nov 24, 2026
Mirror the kind-scoped constant naming from operator-framework#3205 in the GA shape review copies: ClusterExtension condition types and reasons are ClusterExtensionType*/ClusterExtensionReason* and live in clusterextension_types.go; common_types.go is removed. The GA shape's Ready condition is retained (rather than main's Available). Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
Member
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: joelanford The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
openshift-merge-bot
Bot
merged commit Nov 24, 2026
a2b8506
into
operator-framework:main
37 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Addresses the naming feedback from the GA API shape review (#3190 (comment)): unscoped condition type/reason constants (e.g.
TypeInstalled,ReasonSucceeded) make it easy to accidentally use a constant with the wrong API, and hard for humans and bots to spot such mistakes.Changes
ClusterExtensionType*/ClusterExtensionReason*; the constants formerly incommon_types.gonow live inclusterextension_types.goandcommon_types.gois removed.ClusterCatalogType*/ClusterCatalogReason*and addClusterCatalogTypeProgressingplusClusterCatalogReason{Succeeded,Retrying,Blocked}: catalogd was previously borrowing ClusterExtension's constants for the ClusterCatalogProgressingcondition — exactly the cross-API misuse this rename prevents.ClusterObjectDeploymentReasonProgressDeadlineExceededis now defined directly instead of aliasing the shared constant.clusterextension_types_test.gocompleteness test now enforces the scoped naming convention.Constant values are unchanged — CRD schemas, conditions written to the cluster, and stored objects are unaffected. Only Go identifiers change.
Breaking change
Removing the unscoped exported constants is a breaking change for Go consumers of
api/v1. This PR needs thego-apidiff-overridelabel.Testing
go build ./...api/v1,internal/operator-controller/...,internal/catalogd/...,internal/object-controller/...,internal/shared/...,hack/tools/crd-generator/...go vet ./test/... ./hack/tools/crd-generator/...Summary by CodeRabbit