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

Deterministically fail ko {apply, create} #133

Merged
merged 1 commit into from
Feb 11, 2020

Conversation

jonjohnsonjr
Copy link
Collaborator

Fixes #84

When resolving files, we would just log.Fatal if we encountered an
error. This seems to be racy and causes ko to exit with a 0 error code
when it shouldn't. To fix this, we synchronize the builder goroutines
with the kubectl go routine and exit with an error if either of them
failed.

This fix also happened to fix a goroutine leak. If the kubectl goroutine
failed, we never properly cancelled the builds, which would happily
conitnue compiling packages and consuming resources.

When resolving files, we would just log.Fatal if we encountered an
error. This seems to be racy and causes ko to exit with a 0 error code
when it shouldn't. To fix this, we synchronize the builder goroutines
with the kubectl go routine and exit with an error if either of them
failed.

This fix also happened to fix a goroutine leak. If the kubectl goroutine
failed, we never properly cancelled the builds, which would happily
conitnue compiling packages and consuming resources.
@jonjohnsonjr jonjohnsonjr assigned mattmoor and unassigned mattmoor Feb 10, 2020
@jonjohnsonjr
Copy link
Collaborator Author

cc @chaodaiG

@mattmoor
Copy link
Collaborator

LGTM
cc @imjasonh

@chaodaiG
Copy link
Contributor

chaodaiG commented Feb 11, 2020 via email

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.

ko resolve should exit error code when hitting 502 caused by docker repo issue
3 participants