summaryrefslogtreecommitdiff
path: root/cmd/podman/registry/registry.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-05-08 11:09:48 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-05-08 11:09:48 -0400
commit69f62a1a9c09818f888247fec96344cae6e4b6ff (patch)
tree265c2eb6ddcb5dfe1240889a19bc8338566f2f27 /cmd/podman/registry/registry.go
parentae9892e23e378a6bd96884d09b886757c425ac58 (diff)
downloadpodman-69f62a1a9c09818f888247fec96344cae6e4b6ff.tar.gz
podman-69f62a1a9c09818f888247fec96344cae6e4b6ff.tar.bz2
podman-69f62a1a9c09818f888247fec96344cae6e4b6ff.zip
default to tunnel without ABISupport tag
When compiling a Linux binary without ABISupport, default to use the tunnel. The behaviour is expected in `podman-remote`. Also set a default for the remote flag so `podman-remote` works OOB. Signed-off-by: Valentin Rothberg <rothberg@redhat.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/registry/registry.go')
-rw-r--r--cmd/podman/registry/registry.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/cmd/podman/registry/registry.go b/cmd/podman/registry/registry.go
index 69e2babfc..71ee2bed0 100644
--- a/cmd/podman/registry/registry.go
+++ b/cmd/podman/registry/registry.go
@@ -2,14 +2,18 @@ package registry
import (
"context"
+ "path/filepath"
"github.com/containers/libpod/pkg/domain/entities"
"github.com/containers/libpod/pkg/domain/infra"
+ "github.com/containers/libpod/pkg/rootless"
+ "github.com/containers/libpod/pkg/util"
+ "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
-// DefaultAPIAddress is the default address of the REST socket
-const DefaultAPIAddress = "unix:/run/podman/podman.sock"
+// DefaultRootAPIAddress is the default address of the REST socket
+const DefaultRootAPIAddress = "unix:/run/podman/podman.sock"
// DefaultVarlinkAddress is the default address of the varlink socket
const DefaultVarlinkAddress = "unix:/run/podman/io.podman"
@@ -98,3 +102,15 @@ func GetContextWithOptions() context.Context {
func GetContext() context.Context {
return Context()
}
+
+func DefaultAPIAddress() string {
+ if rootless.IsRootless() {
+ xdg, err := util.GetRuntimeDir()
+ if err != nil {
+ logrus.Warnf("Failed to get rootless runtime dir for DefaultAPIAddress: %s", err)
+ return DefaultRootAPIAddress
+ }
+ return "unix:" + filepath.Join(xdg, "podman", "podman.sock")
+ }
+ return DefaultRootAPIAddress
+}