diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/images/build.go | 8 | ||||
-rw-r--r-- | cmd/podman/registry/registry.go | 7 | ||||
-rw-r--r-- | cmd/podman/system/service.go | 17 |
3 files changed, 18 insertions, 14 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index c53798589..0ff482cd9 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -241,8 +241,12 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil } pullPolicy := imagebuildah.PullIfNewer - if c.Flags().Changed("pull") && !flags.Pull { - pullPolicy = imagebuildah.PullIfMissing + if c.Flags().Changed("pull") { + if flags.Pull { + pullPolicy = imagebuildah.PullAlways + } else { + pullPolicy = imagebuildah.PullNever + } } if flags.PullAlways { pullPolicy = imagebuildah.PullAlways diff --git a/cmd/podman/registry/registry.go b/cmd/podman/registry/registry.go index 1e439613c..9c0b290e7 100644 --- a/cmd/podman/registry/registry.go +++ b/cmd/podman/registry/registry.go @@ -12,8 +12,11 @@ import ( "github.com/spf13/cobra" ) -// DefaultRootAPIAddress is the default address of the REST socket -const DefaultRootAPIAddress = "unix:/run/podman/podman.sock" +// DefaultRootAPIPath is the default path of the REST socket +const DefaultRootAPIPath = "/run/podman/podman.sock" + +// DefaultRootAPIAddress is the default address of the REST socket with unix: prefix +const DefaultRootAPIAddress = "unix:" + DefaultRootAPIPath // DefaultVarlinkAddress is the default address of the varlink socket const DefaultVarlinkAddress = "unix:/run/podman/io.podman" diff --git a/cmd/podman/system/service.go b/cmd/podman/system/service.go index 2a2b1984f..0476c632d 100644 --- a/cmd/podman/system/service.go +++ b/cmd/podman/system/service.go @@ -131,20 +131,17 @@ func resolveAPIURI(_url []string) (string, error) { if srvArgs.Varlink { socketName = "io.podman" } - socketDir := filepath.Join(xdg, "podman", socketName) - if _, err := os.Stat(filepath.Dir(socketDir)); err != nil { - if os.IsNotExist(err) { - if err := os.Mkdir(filepath.Dir(socketDir), 0755); err != nil { - return "", err - } - } else { - return "", err - } + socketPath := filepath.Join(xdg, "podman", socketName) + if err := os.MkdirAll(filepath.Dir(socketPath), 0700); err != nil { + return "", err } - return "unix:" + socketDir, nil + return "unix:" + socketPath, nil case srvArgs.Varlink: return registry.DefaultVarlinkAddress, nil default: + if err := os.MkdirAll(filepath.Dir(registry.DefaultRootAPIPath), 0700); err != nil { + return "", err + } return registry.DefaultRootAPIAddress, nil } } |