-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix apiv2 will create containers with incorrect commands #7409
fix apiv2 will create containers with incorrect commands #7409
Conversation
The tests are failing with a real failure. |
if c.config.Command == nil { | ||
// If the user only sets the entrypoint | ||
// should ignore the image's command | ||
if c.config.Entrypoint == nil && c.config.Command == 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.
I don't think this is correct - we should not use image command if entrypoint was set by the user. This check needs to be above the c.config.Entrypoint == nil
check about to make sense.
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 think this is correct - we should not use image command if entrypoint was set by the user. This check needs to be above the
c.config.Entrypoint == nil
check about to make sense.
thanks for reminding
if c.config.Command == nil { | ||
// If the user only sets the entrypoint | ||
// should ignore the image's command | ||
if c.config.Entrypoint == nil && c.config.Command == 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.
Maybe I've not had a enough tea today, but the comment doesn't seem to match the code? I'm not sure we want this change....
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.
Or to put it another way, we only consider setting Cmd when entrypoint is not set by the user
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.
OK, maybe we could shorten lines 486->488 to:
Set CMD in the container to the default configuration only if ENTRYPOINT is not set by the user.
I think that better describes it, thoughts?
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.
It had done,but I only changed the comment. after this, the ci reported an 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've restarted the test. I think it's an intermittent CI error that @edsantiago has been chasing.
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
276e69f
to
88ed130
Compare
The general idea is fine, but there are some detailed problems in the CI, I will try to fix them |
88ed130
to
41a712f
Compare
@mheon @TomSweeneyRedHat PTAL |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan, zhangguanzhang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: zhangguanzhang <[email protected]>
41a712f
to
fa6ba68
Compare
I only changed the comment, but ci reported an error. . . |
LGTM |
@mheon @TomSweeneyRedHat PTAL |
LGTM, but would like @mheon to review to ensure his concern was addressed. |
and happy green test buttons fwiw. |
/lgtm |
Fixes: #7235 (comment)
use the apiv2 to create the container
check the output
and run command is incorrect
if not use apiv2 to run this
after fix
Signed-off-by: zhangguanzhang [email protected]