Skip to content
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

operator-sdk bundle validate should ignore missing examples for "internal" APIs #5551

Closed
wallrj opened this issue Feb 15, 2022 · 8 comments
Closed
Assignees
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs discussion
Milestone

Comments

@wallrj
Copy link

wallrj commented Feb 15, 2022

In https://docs.okd.io/4.9/operators/operator_sdk/osdk-generating-csvs.html#osdk-hiding-internal-objects_osdk-generating-csvs

It is common practice for Operators to use custom resource definitions (CRDs) internally to accomplish a task. These objects are not meant for users to manipulate and can be confusing to users of the Operator. For example, a database Operator might have a Replication CRD that is created whenever a user creates a Database object with replication: true.

As an Operator author, you can hide any CRDs in the user interface that are not meant for user manipulation by adding the operators.operatorframework.io/internal-objects annotation to the cluster service version (CSV) of your Operator.

So there is no reason to add examples (alm-examples) for these internal APIs.

operator-sdk bundle validate should only print a "missing example" warning for the APIs which are not listed in the operators.operatorframework.io/internal-objects annotation.

Related to:

@jmrodri jmrodri self-assigned this Mar 7, 2022
@jmrodri
Copy link
Member

jmrodri commented Mar 7, 2022

I will take this issue and get more information to find out what that validator does and propose some options here in this issue.

@jchunkins
Copy link

This should be the code path for this validation https://github.com/operator-framework/api/blob/master/pkg/validation/internal/csv.go#L78

@camilamacedo86
Copy link
Contributor

camilamacedo86 commented Mar 8, 2022

If I am not wrong, Scorecard also checks the alm-examples. However, it raises a WARN and is not an ERROR, no matter the check.

In POV: If we decide to move forward with the suggestion over not raising warnings, suggestion to add the alm-examples when the CRD is informed via the annotation operators.operatorframework.io/internal-objects:

  • The annotation is valid only for UI / console then, we need to check if it is or not OCP specific first
  • We need to address it in Scorecard and Validators checks

Also, the idea is we have a CVSless bundle in the future, and these annotations ought to become properties with names that clarify better what component actually uses it. So, I'd also ask, how much real value do we bring by addressing this RFE? What problem do authors actually face because of the WARNING suggesting to use the alm-examples? How many operators use operators.operatorframework.io/internal-objects and would take advantage of it?

Thinking on the cost vs benefit here, I think we could spend this effort on other features which could bring more value and help the Operator Authors. However, assuming that the annotation is not OCP specific, I'd not have objections if the community would like to address it.

@theishshah theishshah added this to the v1.20.0 milestone Mar 14, 2022
@theishshah theishshah modified the milestones: v1.20.0, v1.21.0 Apr 27, 2022
@varshaprasad96 varshaprasad96 modified the milestones: v1.21.0, v1.22.0 May 18, 2022
@jmrodri jmrodri modified the milestones: v1.22.0, v1.23.0 Jun 8, 2022
@asmacdo
Copy link
Member

asmacdo commented Jun 29, 2022

This should be filed against api/

@asmacdo asmacdo modified the milestones: v1.23.0, Backlog Jun 29, 2022
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 28, 2022
@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 28, 2022
@openshift-bot
Copy link

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci openshift-ci bot closed this as completed Nov 28, 2022
@openshift-ci
Copy link

openshift-ci bot commented Nov 28, 2022

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs discussion
Projects
None yet
Development

No branches or pull requests

9 participants