-
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
Make use of remoting support consistent between platforms (CONTAINER_HOST) #11196
Comments
Pretty sure we talked about this before.( I think the end solution was going away from using environment variables altogether, and invent "connections"* ? The * there is actually a undocumented CONTAINER_CONNECTION to choose between them.
|
We are coming up on 4.0, so if there is a time to revisit this and make breaking changes, it is now. I do wonder if this should be configurable - have a |
Wouldn't that just mean having one instruction for podman3 and one for podman4, in Python-style ? Currently we got stuck on podman2, since someone reverted my go compiler upgrade (that was needed) At the moment the struggle is with
But it would still be nice if |
I think there was a "remote" flag added to containers.conf, last time around ? #8070 (comment)
|
In fact configurable using config files and/or environment variables is an implementation detail. Both are good and usually env takes precedence over config files, as way to switch the implicit option. What i find key in that feature is that calls made to podman via cli or API should not need to be patched when config is changed. For example we have some ansible code that talks with podman with both approaches and we don't really want to be forced to add conditions for local and remote mode. If podman itself would know which mode to use, we should not bother about having to update the calls. I think that https://github.com/ansible-community/molecule-podman/pull/53/files can be seen as an example that explains the current extra complexity, as the OP tried to find a workaround for allowing him to use remote connections on linux. I am sure we can do better for the v4. I wonder if, for v3 we could maybe add support for |
I guess the suggestion is for remote to be true, and then have it "fall back" on just running if no host or connection is found ? That is, to allow for the |
We have a problem when running multiple "profiles" / clusters, in that the configuration file is shared between shells but the environment variable is possible to set to different things for each shell. The environment variables are problem in that you cannot set them from the command, without having the user run |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
Bottom line on this, you want |
Mostly yes. The reality is that recently I configured podman config to use remote by default. Having that implicit remote would be a great benefit, making "podman" command more portable across different platforms. |
Users enabling CONTAINER_HOST==PATH is indicating to podman they intend to use remote functionality. Fixes: containers#11196 Update man pages to document all of the environment variables. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
/kind bug
Description
Based on discussions made yesterday on irc, I will try to describe what we should do in order to ensure that podman command line works similarly across all platforms.
At this moment on non-linux platforms we do not install
podman-remote
and instead we have apodman
executable which is acting likepodman --remote
. If I understood @mheon correctly, there are no differences between calling podman-remote and podman --remote on platforms that have both executables. On non-linux platforms, we can consider that the--remote
argument is implicit and that some other commands are obviously not available.For example on non-linux hosts, if you define something like
CONTAINER_HOST=ssh://root@hostname/run/podman/podman.sock
,podman
will start using it right away for all commands.That is great because it does match the behavior or docker, which does the same for DOCKER_HOST, were even the APIs do respect the environment variable.
Sadly, the same is not true for Linux podman, were podman will continue to use local host. This creates an undesired divergence in behavior across platforms.
My proposal is to minimic docker behavior which maximizes flexibility and allow users to determine the backend to be used only by environment variables and avoiding the need to add complex conditions in their code like: if not-on-linux and CONTAINER_HOST in environ do add --remote to all podman commands. These kind of hacks to make code complex and prone to bugs.
Describe the results you received:
Describe the results you expected:
As a podman user, I expect to be able to use one or more environment variables to control which backend will be used by podman on all supported platforms. No code that makes use of podman cli or api should need changes in order to be able to do that.
We are aware that this change would need to be introduced in v4.0.0 because it counts as major. Mainly presence of the variable will tell podman to use a different host, something that is not happening how on linux. While I think that the risk is very low (to have the var defined and not to use it already), is better to do it like this.
This change has no impact on macos/windows, as this is already happening there.
PS. Feel free to edit this proposal.
The text was updated successfully, but these errors were encountered: