-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
add docker build distinct error codes #5059
add docker build distinct error codes #5059
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5059 +/- ##
==========================================
+ Coverage 72.35% 72.38% +0.02%
==========================================
Files 371 372 +1
Lines 13042 13114 +72
==========================================
+ Hits 9436 9492 +56
- Misses 2917 2931 +14
- Partials 689 691 +2
Continue to review full report at Codecov.
|
0efcf5a
to
764f25b
Compare
Please visit http://35.235.64.137:1313 to view changes to the docs. |
655f54c
to
3d9f94a
Compare
@@ -115,7 +112,7 @@ func (b *Builder) pullCacheFromImages(ctx context.Context, out io.Writer, a *lat | |||
} | |||
|
|||
if err := b.localDocker.Pull(ctx, out, image); err != nil { | |||
warnings.Printf("Cache-From image couldn't be pulled: %s\n", image) | |||
warnings.Printf("cacheFrom image couldn't be pulled: %s\n", image) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This err
seems like it might be useful to be reported too, doesn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current behavior is to only warn and continue building with a warning. The docker build
might actually succeed if the image is present on remote. Not sure why it was decided. There is a test to verify it too.
func newBuildError(err error) error { | ||
errU := errors.Unwrap(err) | ||
if errU == nil { | ||
return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of errors are these? Why do we return them instead of wrapping them with a BUILD_UNKNOWN error? (is it because they'll be parsed and turned into a error elsewhere?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are known docker errors. Docker wraps these for known types https://github.com/moby/moby/blob/master/errdefs/defs.go
e.g. here
https://github.com/moby/moby/blob/master/errdefs/helpers.go#L138
0ce9698
to
d85b932
Compare
d85b932
to
14c2e36
Compare
should merge after #5060
Related to #4692
In this PR,
Then,
Add distinct error codes for docker build.
Docker exposes two types of error
All these error codes are from https://github.com/moby/moby/blob/master/errdefs/defs.go
These errors can happen for cases like,
getDependencies
In this case of errors executing the steps in dockerfile, a
jsonmessage.JsonError
is thrown.