Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podman-save: log when more than one image is specified #5659

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmd/podman/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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))
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LocalRuntime.SaveImage uses c.inputArgs[1:] as DockerArchiveAdditionalTags. That might be not what the command is expected to do — but this breaks that.

So, either that functionality is useful, and this error needs to be removed (or reworded, or… I don’t know), or it is not, and it should be removed from the code. I guess the former.


runtime, err := adapter.GetRuntime(getContext(), &c.PodmanCommand)
if err != nil {
return errors.Wrapf(err, "could not create runtime")
Expand Down