diff options
-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 | ||||
-rw-r--r-- | libpod/define/errors.go | 6 | ||||
-rw-r--r-- | test/system/030-run.bats | 4 | ||||
-rw-r--r-- | test/system/160-volumes.bats | 2 |
6 files changed, 24 insertions, 20 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 } } diff --git a/libpod/define/errors.go b/libpod/define/errors.go index 300e0d7ca..1b21cd1ce 100644 --- a/libpod/define/errors.go +++ b/libpod/define/errors.go @@ -141,15 +141,15 @@ var ( // ErrOCIRuntimePermissionDenied indicates the OCI runtime attempted to invoke a command that returned // a permission denied error - ErrOCIRuntimePermissionDenied = errors.New("OCI runtime permission denied error") + ErrOCIRuntimePermissionDenied = errors.New("OCI permission denied") // ErrOCIRuntimeNotFound indicates the OCI runtime attempted to invoke a command // that was not found - ErrOCIRuntimeNotFound = errors.New("OCI runtime command not found error") + ErrOCIRuntimeNotFound = errors.New("OCI not found") // ErrOCIRuntimeUnavailable indicates that the OCI runtime associated to a container // could not be found in the configuration - ErrOCIRuntimeUnavailable = errors.New("OCI runtime not available in the current configuration") + ErrOCIRuntimeUnavailable = errors.New("OCI unavailable") // ErrConmonOutdated indicates the version of conmon found (whether via the configuration or $PATH) // is out of date for the current podman version diff --git a/test/system/030-run.bats b/test/system/030-run.bats index 6b6964c63..b0c855d81 100644 --- a/test/system/030-run.bats +++ b/test/system/030-run.bats @@ -14,8 +14,8 @@ load helpers # ...but check the configured runtime engine, and switch to crun as needed run_podman info --format '{{ .Host.OCIRuntime.Path }}' if expr "$output" : ".*/crun"; then - err_no_such_cmd="Error: executable file.* not found in \$PATH: No such file or directory: OCI runtime command not found error" - err_no_exec_dir="Error: open executable: Operation not permitted: OCI runtime permission denied error" + err_no_such_cmd="Error: executable file.* not found in \$PATH: No such file or directory: OCI not found" + err_no_exec_dir="Error: open executable: Operation not permitted: OCI permission denied" fi tests=" diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats index 9f4bb76a2..c19e61669 100644 --- a/test/system/160-volumes.bats +++ b/test/system/160-volumes.bats @@ -119,7 +119,7 @@ EOF # noexec option. This should fail. # ARGH. Unfortunately, runc (used for cgroups v1) produces a different error local expect_rc=126 - local expect_msg='.* OCI runtime permission denied.*' + local expect_msg='.* OCI permission denied.*' run_podman info --format '{{ .Host.OCIRuntime.Path }}' if expr "$output" : ".*/runc"; then expect_rc=1 |