Skip to content

Add support for crun hook stdout/stderr annotations in precreate hooks - #1089

Open
ajoshua2004 wants to merge 1 commit into
podman-container-tools:mainfrom
ajoshua2004:hook-annotations
Open

Add support for crun hook stdout/stderr annotations in precreate hooks#1089
ajoshua2004 wants to merge 1 commit into
podman-container-tools:mainfrom
ajoshua2004:hook-annotations

Conversation

@ajoshua2004

Copy link
Copy Markdown
Contributor

OCI hooks can redirect their output to a file via 2 crun annotations run.oci.hooks.stdout=FILE/run.oci.hooks.stderr=FILE This works for every hook type except precreatehooks, since those are executed directly by podman before the OCI runtime is invoked so crun doesnt get a chance to honor the annotations. This adds the same annotation support to RuntimeConfigFilterWithOptions so precreate hook output anc be redirected too. PR in podman will be needed to bump vendor dependency.

Test

go test ./pkg/hooks/exec/... -run TestRuntimeConfigFilterOutputRedirection -v

Precreate hooks run directly by Podman before the OCI runtime is
invoked, so they never benefit from crun's run.oci.hooks.stdout/
run.oci.hooks.stderr annotations. This adds the same support to
RuntimeConfigFilterWithOptions, opening the annotated file(s) in
append mode (creating if missing, mode 0700 to match crun) and
wiring hook stdout/stderr into them.

Signed-off-by: Joshua Arrevillaga <2004jarrevillaga@gmail.com>
@github-actions github-actions Bot added the common Related to "common" package label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to "common" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant