-
Notifications
You must be signed in to change notification settings - Fork 950
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
bugfix: missing merge some config from image #2156
bugfix: missing merge some config from image #2156
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2156 +/- ##
==========================================
+ Coverage 64.41% 64.45% +0.03%
==========================================
Files 209 209
Lines 16669 16693 +24
==========================================
+ Hits 10738 10760 +22
- Misses 4603 4604 +1
- Partials 1328 1329 +1
|
daemon/mgr/container_types.go
Outdated
if err != nil { | ||
return err | ||
} | ||
|
||
// If user specify the Entrypoint, no need to merge image's configuration. | ||
// Otherwise use the image's configuration to fill it. | ||
// If user specify the Entrypoint, no need to merge image's confuration. |
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.
confuration?
c.Config.WorkingDir = config.WorkingDir | ||
c.Config.WorkingDir = imageConf.WorkingDir | ||
} | ||
|
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.
missing volumes 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.
Update and add.
}); err != nil { | ||
return nil, err | ||
} | ||
|
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.
put merge funtion before initContainerStorage, make mount points generate completely.
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.
Thanks @Ace-Tang for adding the cases for that. But there still need you to update a little thing.
@@ -355,6 +355,18 @@ func (mgr *ContainerManager) Create(ctx context.Context, name string, config *ty | |||
HostConfig: config.HostConfig, | |||
} | |||
|
|||
// merge image's config into container | |||
if err := container.merge(func() (ocispec.ImageConfig, error) { | |||
img, err := mgr.Client.GetImage(ctx, config.Image) |
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.
no error check?
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 should ask the one wrote for it, seems like a bug.
daemon/mgr/container_types_test.go
Outdated
assert.NoError(err) | ||
|
||
// sort slice | ||
|
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.
remove the empty line
1. add user, labels, stop signal and exposed ports config from image config in create container. 2. put merge funtion before initContainerStorage, make mount points generate completely. 3. fix not return error in merge funtion. Signed-off-by: Ace-Tang <aceapril@126.com>
ping @YaoZengzeng and @starnop could you help us to check this failure case? https://travis-ci.org/alibaba/pouch/jobs/420765951
thanks |
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
add user, labels, stop signal and exposed ports config from image
config in create container.
Signed-off-by: Ace-Tang aceapril@126.com
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews