Add support for crun hook stdout/stderr annotations in precreate hooks - #1089
Open
ajoshua2004 wants to merge 1 commit into
Open
Add support for crun hook stdout/stderr annotations in precreate hooks#1089ajoshua2004 wants to merge 1 commit into
ajoshua2004 wants to merge 1 commit into
Conversation
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>
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.
OCI hooks can redirect their output to a file via 2 crun annotations
run.oci.hooks.stdout=FILE/run.oci.hooks.stderr=FILEThis 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 toRuntimeConfigFilterWithOptionsso 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