Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ArgsEscaped exec test #1372

Merged
merged 1 commit into from
Apr 27, 2022
Merged

Conversation

dcantah
Copy link
Contributor

@dcantah dcantah commented Apr 25, 2022

This adds a test to validate execs work with ArgsEscaped images. ArgsEscaped refers to a non-standard OCI image spec field
that indicates that the command line for Windows Containers should be used from args[0] without escaping. This behavior
comes into play with images that use a shell-form ENTRYPOINT or CMD in their Dockerfile. The behavior that the test is testing
is that execs work properly with these images. Hcsshim prefers the commandline field on the OCI runtime spec and will ignore
Args if this is filled in, which ArgsEscaped does. In Containerd/cri plugin the containers runtime spec is used as a base for the execs spec as well, so if commandline isn't cleared out then we'll end up launching the init process again instead of what the user requested.

This adds a test to validate execs work with ArgsEscaped images.
ArgsEscaped refers to a non-standard OCI image spec field
that indicates that the command line for Windows Containers
should be used from args[0] without escaping. This behavior
comes into play with images that use a shell-form ENTRYPOINT
or CMD in their Dockerfile. The behavior that the test is testing
is that execs work properly with these images. Hcsshim prefers
the commandline field on the OCI runtime spec and will ignore
Args if this is filled in, which ArgsEscaped does. In Containerd/cri
plugin the containers runtime spec is used as a base for the execs
spec as well, so if commandline isn't cleared out then we'll end up
launching the init process again instead of what the user requested.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
@dcantah dcantah requested a review from a team as a code owner April 25, 2022 20:53
@dcantah dcantah merged commit 544a27d into microsoft:master Apr 27, 2022
anmaxvl added a commit that referenced this pull request Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants