Skip to content
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

Suppress fatal error reporting when ^C skaffold with jib #1228

Merged
merged 1 commit into from
Oct 31, 2018

Conversation

briandealwis
Copy link
Member

Move kubernetes.IsTerminatedError() into util and make it more general-purpose. Use this new helper to suppress fatal error when the Jib skaffoldFiles target is killed.

Fixes #1198

@codecov-io
Copy link

Codecov Report

Merging #1228 into master will decrease coverage by 0.03%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1228      +/-   ##
==========================================
- Coverage   41.49%   41.45%   -0.04%     
==========================================
  Files          95       96       +1     
  Lines        4234     4238       +4     
==========================================
  Hits         1757     1757              
- Misses       2307     2310       +3     
- Partials      170      171       +1
Impacted Files Coverage Δ
pkg/skaffold/util/process.go 0% <0%> (ø)
pkg/skaffold/jib/jib.go 78.78% <0%> (-5.09%) ⬇️
pkg/skaffold/kubernetes/port_forward.go 40.22% <0%> (+2.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 232ab06...08d02ee. Read the comment docs.

// This error is given when a exec.Command is ran and terminated with a SIGTERM.
func IsTerminatedError(err error) bool {
// unwrap to discover original cause
err = errors.Cause(err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this unwrapping be consistent with what it was before for the port-forward check?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so: .Cause unwinds the error to the source error, and returns the argument if it cannot determine the source error. The port-forward situation must have returned the source error.

@balopat balopat merged commit 246c60c into GoogleContainerTools:master Oct 31, 2018
@briandealwis briandealwis deleted the i1198 branch November 1, 2018 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants