-
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
Podman v2 no longer allows clearing of entrypoint on the command line #6935
Comments
It could be that I don't fully understand how pflags works... or it could be that parsing logic is flawed. All strings seem to default as empty when parsing. I don't see any way, how you would differentiate between an empty string set by user and a default value of empty. Code that I looked at can be found here: podman/cmd/podman/common/create.go For some reason entrypoint and few other bits are not parsed the same way that other variables using. Considering that pflags provides neat interface for handling differences between set, empty and unset values, it might make sense to refactor code to make most of it. My suggestion would be to have type ContainerCLIOpts store pflags as they are. Then provide named accessor functions to access values, so that you don't get magic variables all over the codebase. Accessor such as entrypoint could return ok, if there is actually a value defined Should be trivial to fix and I could do it myself, if I wasn't on vacation 🙂 |
Creating an interface for reading parameters would allow sharing code between API and cli. Interface could be used as one of input parameters to function that forms container spec: options + image + config -> spec -> container |
You can use something like: |
You could, but it would be a dirty hack. As is, code is really hard to follow. But as a quick fix, it should work. Move to ContainerCLIOpts seems like a step towards having common structure and away from magic variables ("entrypoint" = magic var). It just needs another iteration with some love and care. And it desperately needs unit tests |
I'm also having this same issue. Before I was able to clear the entry point with
That's the current version provided by Fedora 32, so this must be affecting many people. |
As a work around this should work. podman run --rm -it --entrypoint=sh alpine/git |
That's a workaround valid only for that particular case, because you want to run the I think that example was used just as a simple scenario to demonstrate the problem. |
Yes, I was only suggesting it for your case. Hopefully My PR will get merged soon, and then we can back port it into podman-2.0.3 |
@rhatdan that would be great :-) Thanks for taking care of this. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Previously, it was possible to override and erase the entrypoint of an image on the CLI. After the switch to cobra flag parsing, it seems that is no longer the case
Steps to reproduce the issue:
podman run --rm -it --entrypoint= alpine/git sh
Describe the results you received:
i.e.
git sh
was runDescribe the results you expected:
an
sh
promptAdditional information you deem important (e.g. issue happens only occasionally):
the
alpine/git
image is small enough to reason with: source. It simply setsgit
as the entrypoint. I used to be able to erase the entrypoint entirely, and havesh
be the command. Sure, I can work around this by settingsh
as the entrypoint here, but for the general case, entrypoints cannot be erased anymore. Just overridden to a new value.Here is the previous introduction of the feature: #585
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):The text was updated successfully, but these errors were encountered: