Skip to content

Add RunOptions.ValidExitCodes and --valid-exit-codes flag#6817

Merged
nalind merged 1 commit into
containers:mainfrom
akca:opexec-validexitcodes
May 1, 2026
Merged

Add RunOptions.ValidExitCodes and --valid-exit-codes flag#6817
nalind merged 1 commit into
containers:mainfrom
akca:opexec-validexitcodes

Conversation

@akca
Copy link
Copy Markdown
Contributor

@akca akca commented Apr 28, 2026

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds a new field RunOptions.ValidExitCodes and a --valid-exit-codes CLI flag for buildah run that lets specific non-zero exit codes be treated as success, aligning with BuildKit's Op_Exec.Meta.ValidExitCodes.

How to verify it

go test -run TestCheckExitCodeError -v .
bats tests/run.bats -f "run-valid-exit-codes"

Which issue(s) this PR fixes:

Fixes #6805

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Added `--valid-exit-codes` flag for `buildah run` to accept specific non-zero exit codes as success.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 28, 2026
@akca akca force-pushed the opexec-validexitcodes branch from ec415bc to 70db65d Compare April 28, 2026 16:10
Comment thread docs/buildah-run.1.md
Comment thread tests/run.bats
@TomSweeneyRedHat
Copy link
Copy Markdown
Member

In general, LGTM
I restarted what looked to be a flaking test.
@nalind WDYT?

@akca akca requested a review from TomSweeneyRedHat April 29, 2026 10:48
@akca akca force-pushed the opexec-validexitcodes branch from 05048b2 to 5b2c4c4 Compare April 29, 2026 16:55
@packit-as-a-service
Copy link
Copy Markdown

Ephemeral COPR build failed. @containers/packit-build please check.

Copy link
Copy Markdown
Member

@nalind nalind left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Please squash these before merging.

@TomSweeneyRedHat
Copy link
Copy Markdown
Member

Thanks!
LGTM
once squished

@akca
Copy link
Copy Markdown
Contributor Author

akca commented Apr 30, 2026

@nalind I don't have squash or merge permissions, could you do it for me?

@nalind
Copy link
Copy Markdown
Member

nalind commented May 1, 2026

I don't think that would include a merge commit, and I've made the mistake of merging PRs without them before. Can you git rebase -i upstream/main or the equivalent, and re-push?

Add support for treating specific non-zero exit codes as success in `buildah run`, aligning with BuildKit's Op_Exec.Meta.ValidExitCodes semantics.

Signed-off-by: Fatih Akca <fatihakca5@gmail.com>
@akca akca force-pushed the opexec-validexitcodes branch from 5b2c4c4 to 6640183 Compare May 1, 2026 14:38
@akca
Copy link
Copy Markdown
Contributor Author

akca commented May 1, 2026

I don't think that would include a merge commit, and I've made the mistake of merging PRs without them before. Can you git rebase -i upstream/main or the equivalent, and re-push?

Sure, just pushed it @nalind

Copy link
Copy Markdown
Member

@nalind nalind left a comment

Choose a reason for hiding this comment

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

Thanks!

@nalind nalind enabled auto-merge May 1, 2026 14:45
@nalind nalind merged commit 377cf64 into containers:main May 1, 2026
37 of 40 checks passed
@akca akca deleted the opexec-validexitcodes branch May 1, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Op_Exec.Meta.ValidExitCodes

3 participants