-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Usage of client-go's discovery.ErrGroupDiscoveryFailed
breaks apimachinery errors.IsNotFound
#2354
Comments
@Fedosin What is the reason for using |
Is this an approach we can take as a fix / patch? I understand that the v0.15.0 contained several changes that had the potential to break us, but detecting whether resources exist is a common operation for controllers to perform, and breaking the pattern of detecting whether a resource exists or not is a problem. |
Just encountered this issue as well. |
Note that this also breaks use of I wonder if this will work: |
I've taken a stab at fixing this in #2472 |
The introduction of the error conversion in controller-runtime v0.15.0:
controller-runtime/pkg/client/apiutil/restmapper.go
Lines 275 to 290 in 30eae58
breaks the use case of checking available APIs via
k8s.io/apimachinery/pkg/api/errors.IsNotFound
:https://github.com/kubernetes/kubernetes/blob/2e306e9632b13a3c1530a7e7ddf52a50f4741523/staging/src/k8s.io/apimachinery/pkg/api/errors/errors.go#L525-L536
Reason is the error conversion, which now needs a workaround like this:
https://github.com/kubernetes-sigs/security-profiles-operator/pull/1710/files#diff-fb01936f787b03e615f35a185799e91ec41896c1fcae0991db3a24137f21cf54R78-R87
Do we want to provide an additional API or something similar to make availability checks simpler?
The text was updated successfully, but these errors were encountered: