-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
errors.IsNotFound not working correctly with client-go #89
Comments
@krmayankk this is likely due to version skew between your version of apimachinery and client-go. Please take a look at this comment here: #83 (comment) We strongly recommend using a tool like Does this code if you do that? |
I am doing a go get, and using glide to get dependencies for my app. But i am not using a specific branch of client-go. Should i be using a specific branch of client-go @ericchiang ? |
@krmayankk you should be using glide to manage client-go. client-go is sensitive to the versions of the packages it imports. However client-go only recently started pinning |
I am using My imports...
Example...
|
|
Is there any issue regarding the |
For those who encounter with this issue , you can check whether your k8s version is equal to your client-go's version . |
When doing reconcile logic of Get-or-Create for OpenShift's elements, treat AlreadyExists error as transient error and just Get the element once again from the API server. This may happen in cases where there is a skew between your apimachinery and client-go versions[1]. [1] kubernetes/client-go#89 Signed-off-by: Shachar Sharon <ssharon@redhat.com>
When doing reconcile logic of Get-or-Create for OpenShift's elements, treat AlreadyExists error as transient error and just Get the element once again from the API server. This may happen in cases where there is a skew between your apimachinery and client-go versions[1]. [1] kubernetes/client-go#89 Signed-off-by: Shachar Sharon <ssharon@redhat.com>
When doing reconcile logic of Get-or-Create for OpenShift's elements, treat AlreadyExists error as transient error and just Get the element once again from the API server. This may happen in cases where there is a skew between your apimachinery and client-go versions[1]. [1] kubernetes/client-go#89 Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Can you give an example of what you mean? I'm running into this issue (still haven't fixed it) and it's not clear if you mean the Kubernetes cluster version (which I largely can't control which version someone is using for my operator) or a package I'm using. Thanks! |
I am using client-go by doing the following imports:-
When i query a deployment which doesn't exist, i see the following in the logs:-
404 tells me its not found
where the exact err i get from the client-go api is
deployments.extensions "default" not found
When i use errors.IsNotFound(err) from the apimachinery, the check fails and it doesn't identify this error as not found error.
Am i missing anything ?
The text was updated successfully, but these errors were encountered: