aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/registry
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2022-01-14 14:41:58 -0700
committerJhon Honce <jhonce@redhat.com>2022-01-20 08:51:34 -0700
commit1f85244abe7d4e930b3922c306cabf2e2ca1cddb (patch)
tree6121517e6c43830d8e8996d491a3a516f5bccb1d /cmd/podman/registry
parent206e57e5b012ae03315dfb84735d034dd9cfd26e (diff)
downloadpodman-1f85244abe7d4e930b3922c306cabf2e2ca1cddb.tar.gz
podman-1f85244abe7d4e930b3922c306cabf2e2ca1cddb.tar.bz2
podman-1f85244abe7d4e930b3922c306cabf2e2ca1cddb.zip
Engine.Remote from containers.conf
Heuristic to initialize TunnelMode/remote podman: - Podman built with remote tag - Podman running on darwin or windows GOOS - CONTAINER_HOST or CONTAINER_CONNECTION set in environment - --remote flag given on command line - From containers.conf, Engine.Remote == true and GOOS == linux Otherwise, podman will run in ABIMode/linked against libpod library. Fixes #12866 Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd/podman/registry')
-rw-r--r--cmd/podman/registry/config.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/cmd/podman/registry/config.go b/cmd/podman/registry/config.go
index f5822d33e..15bb7aee0 100644
--- a/cmd/podman/registry/config.go
+++ b/cmd/podman/registry/config.go
@@ -52,6 +52,12 @@ func newPodmanConfig() {
os.Exit(1)
}
+ cfg, err := config.NewConfig("")
+ if err != nil {
+ fmt.Fprint(os.Stderr, "Failed to obtain podman configuration: "+err.Error())
+ os.Exit(1)
+ }
+
var mode entities.EngineMode
switch runtime.GOOS {
case "darwin", "windows":
@@ -64,16 +70,15 @@ func newPodmanConfig() {
} else {
mode = entities.TunnelMode
}
-
default:
fmt.Fprintf(os.Stderr, "%s is not a supported OS", runtime.GOOS)
os.Exit(1)
}
- cfg, err := config.NewConfig("")
- if err != nil {
- fmt.Fprint(os.Stderr, "Failed to obtain podman configuration: "+err.Error())
- os.Exit(1)
+ // If EngineMode==Tunnel has not been set on the command line or environment
+ // but has been set in containers.conf...
+ if mode == entities.ABIMode && cfg.Engine.Remote {
+ mode = entities.TunnelMode
}
cfg.Network.NetworkConfigDir = cfg.Network.CNIPluginDirs[0]