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
Fix image pull error type ErrRegistryUnavailable
#117612
Fix image pull error type ErrRegistryUnavailable
#117612
Conversation
The current error comparison `imagePullResult.err == ErrRegistryUnavailable` will never work with any remote runtime, because we produce gRPC errors which wrap a code and a description, like: ``` rpc error: code = Unknown desc = This is the error description ``` To be able to check custom error types from `pkg/kubelet/images/types.go`, we now strip the code if the status is unknown on image pull. Beside that, we use a string comparison to check against `ErrRegistryUnavailable.Error()`, because validating them via the `errors` package is not yet supported by grpc-go: grpc/grpc-go#3616 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
65b5bb1
to
4cdfe60
Compare
If we agree on the fix in kubernetes/kubernetes#117612, then we can support the `RegistryUnavailable` error message as well. This has the benefit that we display the information directly to the end user as better error indicator. Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
/test pull-kubernetes-node-e2e-containerd |
/triage accepted |
/lgtm |
LGTM label has been added. Git tree hash: 30aac63ae5ce3ac31eacd8cd56c9a5d448ce7ea1
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mrunalp, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
If we agree on the fix in kubernetes/kubernetes#117612, then we can support the `RegistryUnavailable` error message as well. This has the benefit that we display the information directly to the end user as better error indicator. Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
If we agree on the fix in kubernetes/kubernetes#117612, then we can support the `RegistryUnavailable` error message as well. This has the benefit that we display the information directly to the end user as better error indicator. Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
What type of PR is this?
/kind bug
What this PR does / why we need it:
The current error comparison
imagePullResult.err == ErrRegistryUnavailable
will never work with any remote runtime, because we produce gRPC errors which wrap a code and a description, like:To be able to check custom error types from
pkg/kubelet/images/types.go
, we now strip the code if the status is unknown on image pull.Beside that, we use a string comparison to check against
ErrRegistryUnavailable.Error()
, because validating them via theerrors
package is not yet supported by grpc-go: grpc/grpc-go#3616Which issue(s) this PR fixes:
None
Special notes for your reviewer:
None
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: