From eb17599377220f2db1e694ca55c4f2ea6df66b0f Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 30 Mar 2020 10:29:01 +0200 Subject: [PATCH] podman-save: log when more than one image is specified Podman save can only save one image. While we are planning to support multiple images to catch up with Docker, we still need time to get the work done. Instead of ignoring other arguments, log when there are more than one. Signed-off-by: Valentin Rothberg --- cmd/podman/save.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/podman/save.go b/cmd/podman/save.go index 237ebde03a..550bef2b17 100644 --- a/cmd/podman/save.go +++ b/cmd/podman/save.go @@ -9,6 +9,7 @@ import ( "github.com/containers/libpod/pkg/adapter" "github.com/containers/libpod/pkg/util" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "github.com/spf13/cobra" "golang.org/x/crypto/ssh/terminal" ) @@ -70,6 +71,10 @@ func saveCmd(c *cliconfig.SaveValues) error { return errors.Errorf("need at least 1 argument") } + if len(args) > 1 { + logrus.Errorf("only the first image will be saved but %d are specified", len(args)) + } + runtime, err := adapter.GetRuntime(getContext(), &c.PodmanCommand) if err != nil { return errors.Wrapf(err, "could not create runtime")