diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-04-21 08:05:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-21 08:05:35 -0400 |
commit | 544c3156657e078cef297623842f79cb72dc32c6 (patch) | |
tree | 21431acac4d8c92fb26276680de283e2d0730982 /cmd/podman | |
parent | 41677b192aac6ae2849aa792e4ded856773712fd (diff) | |
parent | 659dc7843c560c9386fbc3e54ad860c3f2ef2940 (diff) | |
download | podman-544c3156657e078cef297623842f79cb72dc32c6.tar.gz podman-544c3156657e078cef297623842f79cb72dc32c6.tar.bz2 podman-544c3156657e078cef297623842f79cb72dc32c6.zip |
Merge pull request #10080 from rhatdan/remote
podman-remote should show podman.sock info
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/system/service_abi.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/cmd/podman/system/service_abi.go b/cmd/podman/system/service_abi.go index 9e8a9f9b4..364663323 100644 --- a/cmd/podman/system/service_abi.go +++ b/cmd/podman/system/service_abi.go @@ -6,11 +6,13 @@ import ( "context" "net" "os" + "path/filepath" "strings" api "github.com/containers/podman/v3/pkg/api/server" "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/podman/v3/pkg/domain/infra" + "github.com/containers/podman/v3/pkg/util" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/pflag" @@ -24,6 +26,17 @@ func restService(opts entities.ServiceOptions, flags *pflag.FlagSet, cfg *entiti ) if opts.URI != "" { + fields := strings.Split(opts.URI, ":") + if len(fields) == 1 { + return errors.Errorf("%s is an invalid socket destination", opts.URI) + } + path := opts.URI + if fields[0] == "unix" { + if path, err = filepath.Abs(fields[1]); err != nil { + return err + } + } + util.SetSocketPath(path) if os.Getenv("LISTEN_FDS") != "" { // If it is activated by systemd, use the first LISTEN_FD (3) // instead of opening the socket file. @@ -34,10 +47,6 @@ func restService(opts entities.ServiceOptions, flags *pflag.FlagSet, cfg *entiti } listener = &l } else { - fields := strings.Split(opts.URI, ":") - if len(fields) == 1 { - return errors.Errorf("%s is an invalid socket destination", opts.URI) - } network := fields[0] address := strings.Join(fields[1:], ":") l, err := net.Listen(network, address) |