diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-09-24 16:53:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-24 16:53:48 +0000 |
commit | 0f5f8dcdd3684955c4fde3d25be4bb8b8a64b24a (patch) | |
tree | a8f7ead5a109433d51e308fd3f1e3672770c77c4 /pkg/domain | |
parent | c191466bd929e85a4862b48c9b3688bf407b9c42 (diff) | |
parent | 1f66a827e892e0133cee6485095e129f0e5047f0 (diff) | |
download | podman-0f5f8dcdd3684955c4fde3d25be4bb8b8a64b24a.tar.gz podman-0f5f8dcdd3684955c4fde3d25be4bb8b8a64b24a.tar.bz2 podman-0f5f8dcdd3684955c4fde3d25be4bb8b8a64b24a.zip |
Merge pull request #7741 from vrothberg/remote-load-dir-check
remote load: check if input is directory
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/infra/tunnel/images.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go index 332a7c2eb..981884109 100644 --- a/pkg/domain/infra/tunnel/images.go +++ b/pkg/domain/infra/tunnel/images.go @@ -199,6 +199,13 @@ func (ir *ImageEngine) Load(ctx context.Context, opts entities.ImageLoadOptions) return nil, err } defer f.Close() + fInfo, err := f.Stat() + if err != nil { + return nil, err + } + if fInfo.IsDir() { + return nil, errors.Errorf("remote client supports archives only but %q is a directory", opts.Input) + } ref := opts.Name if len(opts.Tag) > 0 { ref += ":" + opts.Tag |