-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 support for CRD field selectors #11121
Comments
I was wondering what's the advantage of having a field in the spec (which is then part of the API) when you can already filtering on labels? |
For example better validation? Possible (future) integration across namespaces? |
Can't you validate within the operator against a label instead of accessing a spec field? I don't see much difference from code perspective. If you get some validation from the Kubernetes API (before reaching the operator code) then it's different.
Wdym by this? |
We validate all kinds of
Pointing not just to a resource, but possibly to a resource in another namespace. |
But in this case it would be just a String representing the cluster name. Which kind of validation are you envisaging? |
For example that it is present. |
Triaged on 20.2.2025: This feature seems like a good idea, but we would need to wait until all versions of Kubernetes we support work with this feature, incase for example with older versions the CRD would fail. We should keep this open and work on it in future. |
Kubernetes 1.32 added stable support for custom resource field selectors. This should allow filtering of custom resources based on some field from the custom resource itself.
This might be useful in several situations:
strimzi.io/cluster
labels with a field in the resource spec and then use it by the Kubernetes client to inform only on some resourcesIf we decide that this is useful, we will likely need:
Note: This moved to stable only in 1.32 and it is likely not possible to use it today because of backward compatibility. But should be revisited in the future)
The text was updated successfully, but these errors were encountered: