-
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 jib tool errors #5068
add jib tool errors #5068
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5068 +/- ##
==========================================
- Coverage 72.43% 72.32% -0.12%
==========================================
Files 368 371 +3
Lines 12971 13042 +71
==========================================
+ Hits 9396 9433 +37
- Misses 2886 2918 +32
- Partials 689 691 +2
Continue to review full report at Codecov.
|
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.
Looking good. Some naming suggestions, and I think the ErrDef should support being able to retain the underlying error with an Unwrap()
.
@@ -79,7 +79,7 @@ func (c *cache) lookupLocal(ctx context.Context, hash, tag string, entry ImageDe | |||
// Check the imageID for the tag | |||
idForTag, err := c.client.ImageID(ctx, tag) | |||
if err != nil { | |||
return failed{err: fmt.Errorf("getting imageID for %s: %v", tag, err)} | |||
return failed{err: 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.
This looks unrelated?
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.
Oops, meant to change this comment. Shouldn't this be returning a DIGEST_GET_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.
the underlying c.client.ImageId
returns DIGEST_GET_ERR
for remote and or local.
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.
👍 I wonder if it's worth adding a comment to that effect here?
pkg/skaffold/build/jib/errors.go
Outdated
} | ||
|
||
func jibToolErr(err error) error { | ||
return sErrors.NewError( |
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.
We should be able to retain the errors.
done! |
pkg/skaffold/build/jib/errors.go
Outdated
"github.com/GoogleContainerTools/skaffold/proto" | ||
) | ||
|
||
func unknownPlugin(ws string) error { |
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.
Maybe unknownPluginType()
?
@@ -79,7 +79,7 @@ func (c *cache) lookupLocal(ctx context.Context, hash, tag string, entry ImageDe | |||
// Check the imageID for the tag | |||
idForTag, err := c.client.ImageID(ctx, tag) | |||
if err != nil { | |||
return failed{err: fmt.Errorf("getting imageID for %s: %v", tag, err)} | |||
return failed{err: 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.
👍 I wonder if it's worth adding a comment to that effect here?
fbff009
to
6e954ce
Compare
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
should merge after #5060, #5059
Related to #4692 - Fix Build_UNKNOWN for jib tool
In this PR, I have added 4 jib helper errors and defined distinct error codes for them.
BUILD_UNKNOWN_JIB_PLUGIN
BUILD_UNKNOWN_JIB_PLUGIN
BUILD_JIB_GRADLE_DEP_ERR
andBUILD_JIB_MAVEN_DEP_ERR
BUILD_USER_ERROR
Unfortunately, jib only has 2 exit codes 0 and 1. 1 - indicates failure. We can't do any further processing on if the its a compile time error or not.
I have also added a couple of error codes to surface issues when jib CLI ran successfully but the image built could not be fetched locally or remotely.
BUILD_REMOTE_DIGEST_GET_ERR
&BUILD_LOCAL_DIGEST_GET_ERR