summaryrefslogtreecommitdiff
path: root/cmd/podman/volumes/import.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-05-31 09:27:29 -0400
committerGitHub <noreply@github.com>2022-05-31 09:27:29 -0400
commitdc67e6a182a09c8b65ef139fb9f15ddfdecae70f (patch)
tree8c6cc25dc87deabefe4f89fc2a4d24b14706119c /cmd/podman/volumes/import.go
parentccc087a30e7f84d656663e0b60cd2b918f5288fd (diff)
parentec576a54917d902df0de2daa1935ca22b102a2b9 (diff)
downloadpodman-dc67e6a182a09c8b65ef139fb9f15ddfdecae70f.tar.gz
podman-dc67e6a182a09c8b65ef139fb9f15ddfdecae70f.tar.bz2
podman-dc67e6a182a09c8b65ef139fb9f15ddfdecae70f.zip
Merge pull request #14419 from Luap99/volume-import
podman volume export/import: give better error
Diffstat (limited to 'cmd/podman/volumes/import.go')
-rw-r--r--cmd/podman/volumes/import.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/podman/volumes/import.go b/cmd/podman/volumes/import.go
index 988c5536d..76a311643 100644
--- a/cmd/podman/volumes/import.go
+++ b/cmd/podman/volumes/import.go
@@ -8,6 +8,7 @@ import (
"github.com/containers/podman/v4/cmd/podman/parse"
"github.com/containers/podman/v4/cmd/podman/registry"
"github.com/containers/podman/v4/pkg/domain/entities"
+ "github.com/containers/podman/v4/pkg/errorhandling"
"github.com/containers/podman/v4/utils"
"github.com/pkg/errors"
"github.com/spf13/cobra"
@@ -60,10 +61,14 @@ func importVol(cmd *cobra.Command, args []string) error {
}
inspectOpts.Type = common.VolumeType
- volumeData, _, err := containerEngine.VolumeInspect(ctx, volumes, inspectOpts)
+ inspectOpts.Type = common.VolumeType
+ volumeData, errs, err := containerEngine.VolumeInspect(ctx, volumes, inspectOpts)
if err != nil {
return err
}
+ if len(errs) > 0 {
+ return errorhandling.JoinErrors(errs)
+ }
if len(volumeData) < 1 {
return errors.New("no volume data found")
}