Skip to content

[Enhancement]: define more errors as non-retryable during image pull #2502

@p-jahn

Description

@p-jahn

Proposal

If the docker client returns an error during image pull then the command is retried, except for ErrNotFound.

There are more error types defined in https://github.com/moby/moby/blob/master/errdefs/defs.go that are also permanent, as far as I can tell.

I ran into the issue that, with invalid credentials, the pull was retried until I got temp blocked by the container registry. Pulling with invalid credentials should not be tried again.

Suggested errors to be seen as permanent/non-retryable:

  • ErrInvalidParameter
  • ErrUnauthorized
  • ErrForbidden
  • ErrNotImplemented

I'm unsure if all types might be returned by ImagePull (e.g. ErrNotImplemented seems unlikely). I also didn't check if there are similar places where the docker client is called within a retry mechanism. If so, it might be worth using a central definition that just contains all permanent types.

Happy to provide a PR if you like the suggestion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions