-
Notifications
You must be signed in to change notification settings - Fork 383
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 returned are not typed making it difficult to distinguish for approriate handling. #1110
Comments
Specifically for the Docker client, there is at least Lines 12 to 23 in 122b16a
https://github.com/containers/common/tree/master/pkg/retry might be useful as well. |
Another example of an error (from When writing an application (using this library), I want to be able to ignore cases where source image does not exist. Currently the only way to do this is with a string compare for |
That’s a reasonable request.
But then there are semantic difficulties — some registries (in some configurations?) only ever report “unauthorized” / “denied”, never “manifest unknown”, because users who are not allowed to access images are not allowed to know whether that image exists either. So it’s unclear what the library can do about that. Finally, this would require some kind of interoperability testing infrastructure (which we should have anyway, but sadly we don’t) to be able to make a reasonable API commitment of any kind. |
Hi @mtrmac - thanks for the response, and apologies for the delay in getting back to you. I'm not sure I understand your first point though:
Are you suggesting that (in some cases at least), we should get a typed error back from containers/image? I've just tested with the latest docker distribution code, by running a plain, insecure registry locally (and pushed some images into it):
Here's a code snippet that will use The output looks like:
No sign of a |
@jhart1685 Yes, I’m basically suggesting that, except that Lines 923 to 934 in 29aec5f
|
@mtrmac - ok, thanks. Based on results I'm seeing, I don't believe that new |
Specifically
ImageReference.NewImageSource()
error can indicate that the credentials are rejected (permanent) or alternatively that there is a transient network error e.g. "dial connection timeout", "tls timeout" or 429 "too many requests" (transient).Without string matching it is not possible to distinguish one from another and in order to handle approriately.
Ref: IBM/portieris#238
The text was updated successfully, but these errors were encountered: