-
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
Do not use image CMD if user gave ENTRYPOINT #7256
Do not use image CMD if user gave ENTRYPOINT #7256
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mheon 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 |
https://github.com/containers/podman/pull/7256/checks?check_run_id=959383018
These lines did not work as expected for some reason https://github.com/containers/podman/blob/master/test/system/075-exec.bats#L31-L33 |
This matches Docker behavior, and seems to make sense - the CMD may have been specific to the original entrypoint and probably does not make sense if it was changed. While we're in here, greatly simplify the logic for populating the SpecGen's Command. We create the full command when making the OCI spec, so the client should not be doing any more than setting it to the Command the user passed in, and completely ignoring ENTRYPOINT. Fixes containers#7115 Signed-off-by: Matthew Heon <[email protected]>
927467d
to
39c493b
Compare
Rebased, should go green now |
LGTM |
command := s.Command | ||
if command == nil && img != nil { | ||
if command == nil && img != nil && s.Entrypoint == 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.
What happens if image has a entrypoint and the command is not nil? Isn't it supposed to still be
entrypoint + command?
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.
In that case, we will append command to entrypoint as normal. This block only handles getting CMD from the image if the user didn't give us a command.
/lgtm |
This matches Docker behavior, and seems to make sense - the CMD may have been specific to the original entrypoint and probably does not make sense if it was changed.
While we're in here, greatly simplify the logic for populating the SpecGen's Command. We create the full command when making the OCI spec, so the client should not be doing any more than setting it to the Command the user passed in, and completely ignoring ENTRYPOINT.
Fixes #7115