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

Add ability to hide older apiVersions in a CSV to avoid extra CRD tabs in the OLM UI #6602

Closed
aharbis opened this issue Sep 11, 2020 · 4 comments
Labels
component/olm Related to OLM kind/bug Categorizes issue or PR as related to a bug.

Comments

@aharbis
Copy link

aharbis commented Sep 11, 2020

We recently added a new apiVersion to our operator so our ClusterServiceVersion provides metadata for both v1beta1 and v1beta2 CRDs. On OCP 4.5 this leads to some interesting (and undesireable) behavior in the Operator UI.

In our v1beta1 API group, we have a single CRD: DataPowerService.
In our v1beta2 API group, we have two CRDs: DataPowerService and DataPowerMonitor.

In the UI, there are two tabs rendered for DataPowerService, one for each API version.

image

This is undesirable, because v1beta2 is our stored version. We don't really want users creating v1beta1 CRs, and if they do they'll be converted to v1beta2 and persisted at that version.

It would be ideal if we could (through CSV metadata hopefully) disable certain apiVersions from showing in the UI. Our operator still of course needs to know about the older versions, and the DataPowerService CRD itself does need to include both versioned schemas to support conversion etc., but there's no reason (in my opinion) for there to be a v1beta1 CRD tab in the UI.

@spadgett
Copy link
Member

spadgett commented Oct 9, 2020

cc @TheRealJon @tlwu2013

Do you guys know if this is possible with the internal resource annotation?

@spadgett spadgett added component/olm Related to OLM kind/feature Categorizes issue or PR as related to a new feature. labels Oct 9, 2020
@TheRealJon
Copy link
Member

Normally, yes we could hide a provided API and the corresponding instance list tab using the 'operators.operatorframework.io/internal-objects' annotation. But, this would be an interesting case because that annotation only accepts a CRD name. So, if we add the DataPowerService to it, I believe all of the provided API cards and instance tabs would be hidden, not just a specific API version. We would need to add the ability to provide API version along with CRD name in that annotation in order to support hiding only a specific version. That or we add some other logic where we only show the latest API version of each CRD.

@spadgett
Copy link
Member

We should probably only show one API version for each kind/group. We can use the utility added in #5355 to find the preferred version.

@spadgett spadgett added kind/bug Categorizes issue or PR as related to a bug. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Oct 12, 2020
@TheRealJon
Copy link
Member

This is now being tracked in bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1888036
Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/olm Related to OLM kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants