This repository has been archived by the owner on Mar 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 348
[release/1.2] Backport fix for default UNIX environment in OCI container config #1283
Merged
Conversation
This file contains 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
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
Random-Liu
reviewed
Sep 19, 2019
pkg/server/container_create.go
Outdated
@@ -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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do this in defaultRuntimeSpec
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Signed-off-by: Phil Estes <[email protected]>
mikebrow
approved these changes
Sep 20, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/lgtm |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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 theoci.With..
helper in this design.Signed-off-by: Phil Estes [email protected]