Skip to content

add .status.relatedObjects to clusterversion to get CVO references #2339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented May 22, 2025

This will allow oc adm inspect to gather pertinent data. The CVO will need to grow a control loop that reconciles this new field. My preference will be server-side-apply, perhaps even the super naive "apply this manifest" approach.

/assign @wking

Copy link
Contributor

openshift-ci bot commented May 22, 2025

Hello @deads2k! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 22, 2025
@openshift-ci openshift-ci bot requested review from everettraven and JoelSpeed May 22, 2025 13:13
Copy link
Contributor

openshift-ci bot commented May 22, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 22, 2025
// 2. operand namespaces
// +optional
// +openshift:enable:FeatureGate=CVORelatedObjects
RelatedObjects []ObjectReference `json:"relatedObjects,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+listType=map and appropriate listMapKey missing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+listType=map and appropriate listMapKey missing

Will do. Consideration for our future, will we fix the existing usages too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they're in status, I would expect we are already doing the right thing and so should be fine to fix it

I also assume these would ratchet 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh very neat. I think you can only make map keys on required fields and not all the fields are logically required. I might go with atomic (single writer of this thing anyway)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can only make map keys on required fields and not all the fields are logically required

Yes I agree, the required ones are group, name and resource, so potential overlap on namespace?

If you don't have the listType enforcing the uniqueness, how about CEL?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reference, the incantation is

+kubebuilder:validation:XValiadtion:rule="self.all(x, self.exists_one(y, x == y))",message="items in relatedObjects should be unique"

// 2. operand namespaces
// +optional
// +openshift:enable:FeatureGate=CVORelatedObjects
RelatedObjects []ObjectReference `json:"relatedObjects,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List should set a sensible maximum length, given intended use case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List should set a sensible maximum length, given intended use case

I'm so glad I insisted on these linters :)

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 22, 2025
@deads2k
Copy link
Contributor Author

deads2k commented May 22, 2025

/hold

I want to see this work all the way through the client before committing. I seem to recall that map keys are required to be required.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 22, 2025
// `oc adm inspect` honors this field in any type to navigate and collect related data.
// Common uses are:
// 1. operator namespaces
// 2. operand namespaces
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We obviously want to include the openshift-cluster-version namespace for our operator, but "operand" gets a bit sticky with the CVO. Do we do just our own namespace on the thin end, and build out CVO logging as needed to help debug things where we don't capture enough to debug a resource we're failing to reconcile? Or all ~1k resources release-manifests are asking us to manage on the thick end? Or pick some middle ground like "asking for all ClusterOperators is easy, and likely covers reporting on most of the resources we care about"? Or...?

@deads2k deads2k force-pushed the cvo-related-resources-master branch from c65bf41 to 8807b6d Compare May 27, 2025 18:12
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 27, 2025
@JoelSpeed
Copy link
Contributor

API LGTM if we are happy with the 100 resource limit

@deads2k deads2k force-pushed the cvo-related-resources-master branch 2 times, most recently from 741cb7c to b85e830 Compare May 30, 2025 19:22
@deads2k deads2k force-pushed the cvo-related-resources-master branch from b85e830 to 8b7ce44 Compare May 30, 2025 19:54
Copy link
Contributor

openshift-ci bot commented May 30, 2025

@deads2k: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-serial-techpreview-1of2 8b7ce44 link true /test e2e-aws-serial-techpreview-1of2
ci/prow/integration 8b7ce44 link true /test integration
ci/prow/e2e-aws-ovn-hypershift 8b7ce44 link true /test e2e-aws-ovn-hypershift

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants