knative / operator

Combined operator for Knative.
Apache License 2.0
179 stars 98 forks source link

Subscription: shortName can have potential conflicts #1758

Open 010gvr opened 8 months ago

010gvr commented 8 months ago

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

pierDipi commented 8 months ago

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

010gvr commented 8 months ago

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.

pierDipi commented 6 months ago

@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

github-actions[bot] commented 3 months ago

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] commented 6 days ago

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.