Description
openedon Aug 11, 2021
/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 a podman
executable which is acting like podman --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.