diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-02-27 17:39:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-27 17:39:13 +0100 |
commit | f1f26f444228381224581609a327f13158740923 (patch) | |
tree | 724d87cdcc26839cb155a0ce5c52dc4ede0d88c0 /pkg | |
parent | fd16be5c00533e5237bfaa640e5afb4b45d29aa5 (diff) | |
parent | ffefbda6943028119d43e1f5f9e4e9fb541f5e89 (diff) | |
download | podman-f1f26f444228381224581609a327f13158740923.tar.gz podman-f1f26f444228381224581609a327f13158740923.tar.bz2 podman-f1f26f444228381224581609a327f13158740923.zip |
Merge pull request #2465 from mheon/fix_build_varlink
Fix build for non-Varlink-tagged Podman
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/adapter/runtime.go | 8 | ||||
-rw-r--r-- | pkg/adapter/runtime_remote.go | 12 |
2 files changed, 20 insertions, 0 deletions
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 +} |