operator icon indicating copy to clipboard operation
operator copied to clipboard

Subscription: shortName can have potential conflicts

Open 010gvr opened this issue 2 years ago • 5 comments

Describe the bug Having a generic shortname for Subscription CRD like sub is prone to ambiguity which isn't handled very well by kubectl or other clients. We came across a potential conflict in openshift (as described in https://issues.redhat.com/browse/OCPBUGS-22092). While using FQNs is the perfect solution, nothing will stop users from using alias/shortNames leading to a potential problem (due to the client limitations) or even breaking of scripts.

Expected behavior CRDs have a shortname that's as unique as possible to the product. Otherwise, remove them to avoid potential conflicts.

To Reproduce Install/update two CRDs with same shortName in different order and use the shortName with the clients kubectl get sub .

Knative release version All

Additional context Originally noticed on openshift https://github.com/openshift-knative/serverless-operator/pull/2341 and turns out addressing the bug here at the source will be more effective. I can get a similar PR if the owners agree otherwise please close with a reason.

Read more here: https://github.com/kubernetes/kubernetes/issues/94860 , https://github.com/kubernetes/kubernetes/issues/108573 and dozen more

010gvr avatar Oct 19 '23 09:10 010gvr

The problem is that removing or changing the name is a breaking change

pierDipi avatar Oct 19 '23 10:10 pierDipi

yes, agree. imho, this feels like an architectural issue on kubernetes side - either the server side APIs must be validating & rejecting CRDs with ambiguous shortNames OR the client (kubectl) should be intelligent enough to handle the ambiguity or at least warn. Looking at the issues reported on kubernetes and discussions from the code owners, any of this option is going to be a long route.

shortName updates may be nice to have for the next major version release.

010gvr avatar Oct 20 '23 04:10 010gvr

@010gvr I think we can have this behavior behind a feature flag on knative/operator side https://knative.dev/docs/eventing/experimental-features/, feel to contribute and I'm happy to help on the specific in case something in not clear, etc

pierDipi avatar Dec 05 '23 11:12 pierDipi

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Mar 05 '24 01:03 github-actions[bot]

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Jun 25 '24 01:06 github-actions[bot]