-
Notifications
You must be signed in to change notification settings - Fork 347
Apply container image config #52
Apply container image config #52
Conversation
|
I've run all CRI validation test. Only the container log and |
326b8b7 to
8de8304
Compare
3c22097 to
0609417
Compare
|
|
||
| // addImageEnvs adds environment variables from image config. It returns error if | ||
| // an invalid environment variable is encountered. | ||
| func addImageEnvs(g *generate.Generator, imageEnvs []string) error { |
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.
I was wondering why you didn't do this in the sandbox PR ;)
| if err != nil { | ||
| glog.Exitf("Failed to create CRI containerd service %+v: %v", o, err) | ||
| } | ||
| if err := service.Start(); err != nil { |
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.
Why is this in the PR?
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.
Found this when running cri validation container test.
I could send another PR to fix this.
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.
Since travis is overloaded, it takes a long time to test a PR.
I'll split this into another commit.
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.
pkg/server/container_create.go
Outdated
| // Prepare container image snapshot. For container, the image should have | ||
| // been pulled before creating the container, so do not ensure the image. | ||
| image := config.GetImage().GetImage() | ||
| imageMeta, err := c.ensureImageExists(ctx, image, false /*ensure*/) |
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.
Commented on #48. Would prefer breaking down the function.
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.
Will do.
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.
pkg/server/container_start.go
Outdated
| func setOCIProcessArgs(g *generate.Generator, config *runtime.ContainerConfig, imageConfig *imagespec.ImageConfig) error { | ||
| command, args := config.GetCommand(), config.GetArgs() | ||
| // The following logic is migrated from https://github.com/moby/moby/blob/master/daemon/commit.go | ||
| // TODO(random-liu): Figure out whether the following logic is |
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.
is...?
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.
Incomplete comment, will complete it.
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.
| command, args := config.GetCommand(), config.GetArgs() | ||
| // The following logic is migrated from https://github.com/moby/moby/blob/master/daemon/commit.go | ||
| // TODO(random-liu): Figure out whether the following logic is | ||
| if len(command) == 0 { |
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.
I don't entirely understand why the code below is organized this way...
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.
This is the current behavior of docker, I don't fully understood it, either. However, there is no definition of how this should behave, so I just reuse the docker logic.
The TODO is to clearly define this and fix the logic here.
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.
0609417 to
5ba915b
Compare
|
@yujuhong Addressed comments. |
|
LGTM |
|
Apply lgtm based on #52 (comment), will rebase and merge this PR after test passes and dependency is merged. |
Signed-off-by: Lantao Liu <[email protected]>
Signed-off-by: Lantao Liu <[email protected]>
Signed-off-by: Lantao Liu <[email protected]>
5ba915b to
80384fc
Compare
mikebrow
left a comment
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
…e-config Apply container image config
add support for kubernetes empty dir in LCOW
Based on #41, #46 and #48.
This PR pulls container image and applies image config.
Only the last commit is new. Will rebase the PR and previous PRs soon.