Add code to return errors from registries #3109
Add code to return errors from registries #3109crosbymichael merged 2 commits intocontainerd:masterfrom
Conversation
|
CI commit check failed due to "subject > 90 chars"; commit messages are expected in the form: |
0b64d2c to
c9aa764
Compare
Docker registries return errors in a know format so this change now checks for these errors and returns the message field. If the error is not in the expected format fall back to the original behaviour. containerd#3076 Signed-off-by: Jack Baines <jack.baines@uk.ibm.com>
Codecov Report
@@ Coverage Diff @@
## master #3109 +/- ##
=========================================
+ Coverage 43.59% 43.69% +0.1%
=========================================
Files 104 104
Lines 11135 11142 +7
=========================================
+ Hits 4854 4869 +15
+ Misses 5545 5537 -8
Partials 736 736
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #3109 +/- ##
=========================================
+ Coverage 43.59% 43.69% +0.1%
=========================================
Files 104 104
Lines 11135 11142 +7
=========================================
+ Hits 4854 4869 +15
+ Misses 5545 5537 -8
Partials 736 736
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #3109 +/- ##
=========================================
+ Coverage 43.59% 43.69% +0.1%
=========================================
Files 104 104
Lines 11135 11142 +7
=========================================
+ Hits 4854 4869 +15
+ Misses 5545 5537 -8
Partials 736 736
Continue to review full report at Codecov.
|
remotes/docker/fetcher.go
Outdated
| "strings" | ||
|
|
||
| "github.com/docker/distribution/registry/api/errcode" | ||
|
|
There was a problem hiding this comment.
That new line is added by goimport which is run as part of the CI tests, so I believe it would cause the travis build to fail if I remove it
There was a problem hiding this comment.
if you add it after containerd/containerd/log you should be able to verify with gofmt that that would allow all external imports to be in the same section (which is pretty normal) rather than having it stand by itself. goimport isn't always as smart about combining these sections.
There was a problem hiding this comment.
Sorry I was looking at the _test file when I first read this. There is an extra space as you say. Will fix
remotes/docker/fetcher_test.go
Outdated
| } | ||
|
|
||
| // New set of test to test new error cases | ||
| func Test_dockerFetcher_open(t *testing.T) { |
There was a problem hiding this comment.
looks a bit python-esque? :) Maybe TestDockerFetcherOpen?
There was a problem hiding this comment.
Yeah sure can change
-Fix whitespace on imports -Fix test case naming Signed-off-by: Jack Baines <jack.baines@uk.ibm.com>
|
LGTM |
|
LGTM |
Update to containerd#3109 Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
If there are no errors in the correct format expected from docker Registry it then it falls back to the old behaviour
#3076
Signed-off-by: Jack Baines jack.baines@uk.ibm.com