Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

[release/1.2] Backport fix for default UNIX environment in OCI container config #1283

Merged
merged 1 commit into from
Sep 20, 2019

Conversation

estesp
Copy link
Member

@estesp estesp commented Sep 19, 2019

Backport test from #1280; harcoded defaultUnixEnv from containerd/containerd brought into the spec generator sequence, as there is no clear way to fix the bug using the oci.With.. helper in this design.

Signed-off-by: Phil Estes estesp@linux.vnet.ibm.com

@estesp estesp changed the title Backport fix for default UNIX environment in OCI container config [release/1.2] Backport fix for default UNIX environment in OCI container config Sep 19, 2019
@@ -321,6 +322,8 @@ func (c *criService) generateContainerSpec(id string, sandboxID string, sandboxP
// Set the relative path to the rootfs of the container from containerd's
// pre-defined directory.
g.SetRootPath(relativeRootfsPath)
// add default UNIX path; overwritten optionally by image config PATH env
g.AddProcessEnv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
Copy link
Member

Choose a reason for hiding this comment

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

Do this in defaultRuntimeSpec.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done; added to section where spec.Linux is non-nil as it only makes sense to have a default UNIX-like PATH for Linux specs.

Copy link
Member

Choose a reason for hiding this comment

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

We only support linux in 1.2 actually. :)

But this is fine.

@Random-Liu Random-Liu self-assigned this Sep 19, 2019
@Random-Liu Random-Liu added this to the v1.2 milestone Sep 19, 2019
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM

@Random-Liu
Copy link
Member

/lgtm

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants