Repository navigation
Conversation
With --fail-fast, kbld resolve stops starting new image builds once an image has failed, so a failure is reported without waiting for the remaining builds to run. Builds that are already running are left to finish. The default behavior is unchanged. Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
kbld resolve --fail-fast(defaultfalse). Once one image fails, the queue does not start the images that are still waiting, and the command returns the error. This avoids waiting for dozens of remaining builds when one of them has already failed.Limitation: builds that are already running are not cancelled, they run to completion. Cancelling them would mean passing a context through the docker, pack, ko and bazel builders, which I did not want to change in the same PR. Happy to follow up on that if you want it.
ImageQueuenow takes a smallimageFactoryinterface instead of the concretectlimg.Factoryso it can be tested with a fake;ctlimg.Factorysatisfies it, so callers are unchanged.Tests:
TestImageQueueFailFast(one worker, first image fails, the rest are not started) and a test that without the flag every image is still processed. I rango test ./pkg/kbld/cmd; the e2e tests were not run. The flag docs live in the carvel.dev website repo.Fixes #581