diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-13 06:03:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-13 06:03:51 -0500 |
commit | 85460bc41cb67e668bc8b7196346685691953176 (patch) | |
tree | dc468234187ffb7c1c1eff0133d237babbea1b8b /cmd/podman/images/load.go | |
parent | f52a9eeeea75fe84fceb6aa347888d61a5cecd59 (diff) | |
parent | a6046dceeff21bbeea71c0ab5c3d78ff931aa019 (diff) | |
download | podman-85460bc41cb67e668bc8b7196346685691953176.tar.gz podman-85460bc41cb67e668bc8b7196346685691953176.tar.bz2 podman-85460bc41cb67e668bc8b7196346685691953176.zip |
Merge pull request #8877 from rhatdan/load
Remove the ability to use [name:tag] in podman load command
Diffstat (limited to 'cmd/podman/images/load.go')
-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 { |