Skip to content

Add --fail-fast flag to kbld resolve - #613

Open
cvas22 wants to merge 1 commit into
carvel-dev:developfrom
cvas22:feat/581-fail-fast
Open

cvas22 wants to merge 1 commit into
carvel-dev:developfrom
cvas22:feat/581-fail-fast

Conversation

@cvas22

@cvas22 cvas22 commented Oct 23, 2026

Copy link
Copy Markdown

Adds kbld resolve --fail-fast (default false). 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.

ImageQueue now takes a small imageFactory interface instead of the concrete ctlimg.Factory so it can be tested with a fake; ctlimg.Factory satisfies 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 ran go test ./pkg/kbld/cmd; the e2e tests were not run. The flag docs live in the carvel.dev website repo.

Fixes #581

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Fail Fast option

1 participant