Skip to content
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

Merged
merged 1 commit into from May 2, 2023

Conversation

saschagrunert
Copy link
Member

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:

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

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

Fixed bug to correctly report `ErrRegistryUnavailable` on pulling container images for remote CRI runtimes.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

None

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 26, 2023
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 26, 2023
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>
saschagrunert added a commit to saschagrunert/cri-o that referenced this pull request Apr 26, 2023
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>
@saschagrunert
Copy link
Member Author

/test pull-kubernetes-node-e2e-containerd

@rphillips
Copy link
Member

/triage accepted
/priority important-soon

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 26, 2023
@rphillips
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 26, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 30aac63ae5ce3ac31eacd8cd56c9a5d448ce7ea1

@bart0sh bart0sh added this to Triage in SIG Node PR Triage Apr 26, 2023
@bart0sh bart0sh moved this from Triage to Needs Approver in SIG Node PR Triage Apr 26, 2023
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 2, 2023
@k8s-ci-robot k8s-ci-robot merged commit 72afd85 into kubernetes:master May 2, 2023
12 checks passed
SIG Node PR Triage automation moved this from Needs Approver to Done May 2, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.28 milestone May 2, 2023
@saschagrunert saschagrunert deleted the image-pull-errors branch May 2, 2023 07:02
saschagrunert added a commit to saschagrunert/cri-o that referenced this pull request May 3, 2023
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>
saschagrunert added a commit to saschagrunert/cri-o that referenced this pull request May 3, 2023
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants