summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/tunnel
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-09-23 09:57:38 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-09-24 14:40:54 +0200
commit1f66a827e892e0133cee6485095e129f0e5047f0 (patch)
treeb5b64ea221e588bfa27a8d7dcbb196987d8ce22e /pkg/domain/infra/tunnel
parent08cc91926db1cd17509f8578e2ff00a94747dbd4 (diff)
downloadpodman-1f66a827e892e0133cee6485095e129f0e5047f0.tar.gz
podman-1f66a827e892e0133cee6485095e129f0e5047f0.tar.bz2
podman-1f66a827e892e0133cee6485095e129f0e5047f0.zip
remote load: check if input is directory
The remote client does not support loading directories yet. To prevent confusing error messages and to make the behaviour more explicit, check if the input points to a directory and throw an error if needed. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/domain/infra/tunnel')
-rw-r--r--pkg/domain/infra/tunnel/images.go7
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