diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-01-04 13:31:57 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2021-01-12 17:38:32 -0500 |
commit | a6046dceeff21bbeea71c0ab5c3d78ff931aa019 (patch) | |
tree | dc468234187ffb7c1c1eff0133d237babbea1b8b /cmd | |
parent | 3ff8f2765129b4edd7f8902cf1605db4fdabf034 (diff) | |
download | podman-a6046dceeff21bbeea71c0ab5c3d78ff931aa019.tar.gz podman-a6046dceeff21bbeea71c0ab5c3d78ff931aa019.tar.bz2 podman-a6046dceeff21bbeea71c0ab5c3d78ff931aa019.zip |
Remove the ability to use [name:tag] in podman load command
Docker does not support this, and it is confusing what to do if
the image has more then one tag. We are dropping support for this
in podman 3.0
Fixes: https://github.com/containers/podman/issues/7387
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/images/load.go | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/cmd/podman/images/load.go b/cmd/podman/images/load.go index a24f46781..59fc6f54c 100644 --- a/cmd/podman/images/load.go +++ b/cmd/podman/images/load.go @@ -9,9 +9,8 @@ import ( "strings" "github.com/containers/common/pkg/completion" - "github.com/containers/image/v5/docker/reference" - "github.com/containers/podman/v2/cmd/podman/parse" "github.com/containers/podman/v2/cmd/podman/registry" + "github.com/containers/podman/v2/cmd/podman/validate" "github.com/containers/podman/v2/pkg/domain/entities" "github.com/containers/podman/v2/pkg/util" "github.com/pkg/errors" @@ -22,11 +21,11 @@ import ( var ( loadDescription = "Loads an image from a locally stored archive (tar file) into container storage." loadCommand = &cobra.Command{ - Use: "load [options] [NAME[:TAG]]", + Use: "load [options]", Short: "Load image(s) from a tar archive", Long: loadDescription, RunE: load, - Args: cobra.MaximumNArgs(1), + Args: validate.NoArgs, ValidArgsFunction: completion.AutocompleteNone, } @@ -71,22 +70,8 @@ func loadFlags(cmd *cobra.Command) { } func load(cmd *cobra.Command, args []string) error { - if len(args) > 0 { - ref, err := reference.Parse(args[0]) - if err != nil { - return err - } - if t, ok := ref.(reference.Tagged); ok { - loadOpts.Tag = t.Tag() - } else { - loadOpts.Tag = "latest" - } - if r, ok := ref.(reference.Named); ok { - loadOpts.Name = r.Name() - } - } if len(loadOpts.Input) > 0 { - if err := parse.ValidateFileName(loadOpts.Input); err != nil { + if _, err := os.Stat(loadOpts.Input); err != nil { return err } } else { |