summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cirrus.yml5
-rw-r--r--cmd/podman/rmi.go19
-rw-r--r--contrib/gate/Dockerfile2
-rw-r--r--pkg/adapter/runtime.go8
-rw-r--r--pkg/adapter/runtime_remote.go12
5 files changed, 28 insertions, 18 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index ad9edd404..4521866d1 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -118,6 +118,11 @@ gating_task:
- '/usr/local/bin/entrypoint.sh vendor'
- 'cd /go/src/github.com/containers/libpod && ./hack/tree_status.sh'
+ # This task builds Podman with different buildtags to ensure the build does
+ # not break.
+ build_script:
+ - '/usr/local/bin/entrypoint.sh clean podman BUILDTAGS="exclude_graphdriver_devicemapper selinux seccomp"'
+
build_each_commit_task:
diff --git a/cmd/podman/rmi.go b/cmd/podman/rmi.go
index 0963b1328..e5bb9b486 100644
--- a/cmd/podman/rmi.go
+++ b/cmd/podman/rmi.go
@@ -5,8 +5,6 @@ import (
"os"
"github.com/containers/libpod/cmd/podman/cliconfig"
- "github.com/containers/libpod/cmd/podman/varlink"
- "github.com/containers/libpod/libpod/image"
"github.com/containers/libpod/pkg/adapter"
"github.com/containers/storage"
"github.com/pkg/errors"
@@ -31,17 +29,6 @@ var (
}
)
-func imageNotFound(err error) bool {
- if errors.Cause(err) == image.ErrNoSuchImage {
- return true
- }
- switch err.(type) {
- case *iopodman.ImageNotFound:
- return true
- }
- return false
-}
-
func init() {
rmiCommand.Command = _rmiCommand
rmiCommand.SetUsageTemplate(UsageTemplate())
@@ -80,7 +67,7 @@ func rmiCmd(c *cliconfig.RmiValues) error {
if errors.Cause(err) == storage.ErrImageUsedByContainer {
fmt.Printf("A container associated with containers/storage, i.e. via Buildah, CRI-O, etc., may be associated with this image: %-12.12s\n", img.ID())
}
- if !imageNotFound(err) {
+ if !adapter.IsImageNotFound(err) {
failureCnt++
}
if lastError != nil {
@@ -135,7 +122,7 @@ func rmiCmd(c *cliconfig.RmiValues) error {
newImage, err := runtime.NewImageFromLocal(i)
if err != nil {
if lastError != nil {
- if !imageNotFound(lastError) {
+ if !adapter.IsImageNotFound(lastError) {
failureCnt++
}
fmt.Fprintln(os.Stderr, lastError)
@@ -147,7 +134,7 @@ func rmiCmd(c *cliconfig.RmiValues) error {
}
}
- if imageNotFound(lastError) && failureCnt == 0 {
+ if adapter.IsImageNotFound(lastError) && failureCnt == 0 {
exitCode = 1
}
diff --git a/contrib/gate/Dockerfile b/contrib/gate/Dockerfile
index f9b57a6da..4d88ae9a6 100644
--- a/contrib/gate/Dockerfile
+++ b/contrib/gate/Dockerfile
@@ -49,8 +49,6 @@ WORKDIR $GOSRC
# Install dependencies
RUN set -x && \
- go get -u github.com/mailru/easyjson/... && \
- install -D -m 755 "$GOPATH"/bin/easyjson /usr/bin/ && \
make install.tools && \
install -D -m 755 $GOSRC/contrib/gate/entrypoint.sh /usr/local/bin/ && \
rm -rf "$GOSRC"
diff --git a/pkg/adapter/runtime.go b/pkg/adapter/runtime.go
index 4f5b98dbb..8624981b1 100644
--- a/pkg/adapter/runtime.go
+++ b/pkg/adapter/runtime.go
@@ -333,3 +333,11 @@ func (r *LocalRuntime) LoadImage(ctx context.Context, name string, cli *cliconfi
}
return r.Runtime.LoadImage(ctx, name, cli.Input, writer, cli.SignaturePolicy)
}
+
+// IsImageNotFound checks if the error indicates that no image was found.
+func IsImageNotFound(err error) bool {
+ if errors.Cause(err) == image.ErrNoSuchImage {
+ return true
+ }
+ return false
+}
diff --git a/pkg/adapter/runtime_remote.go b/pkg/adapter/runtime_remote.go
index ca2fad852..29b43e9b0 100644
--- a/pkg/adapter/runtime_remote.go
+++ b/pkg/adapter/runtime_remote.go
@@ -796,3 +796,15 @@ func (r *LocalRuntime) LoadImage(ctx context.Context, name string, cli *cliconfi
}
return names, nil
}
+
+// IsImageNotFound checks if the error indicates that no image was found.
+func IsImageNotFound(err error) bool {
+ if errors.Cause(err) == image.ErrNoSuchImage {
+ return true
+ }
+ switch err.(type) {
+ case *iopodman.ImageNotFound:
+ return true
+ }
+ return false
+}