diff options
Diffstat (limited to 'cmd/podman/images')
-rw-r--r-- | cmd/podman/images/build.go | 1 | ||||
-rw-r--r-- | cmd/podman/images/list.go | 15 | ||||
-rw-r--r-- | cmd/podman/images/pull.go | 13 | ||||
-rw-r--r-- | cmd/podman/images/save.go | 7 |
4 files changed, 21 insertions, 15 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index 00777c48c..d24bb18b6 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -436,6 +436,7 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil Quiet: flags.Quiet, RemoveIntermediateCtrs: flags.Rm, ReportWriter: reporter, + Runtime: containerConfig.RuntimePath, RuntimeArgs: runtimeFlags, SignBy: flags.SignBy, SignaturePolicyPath: flags.SignaturePolicy, diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go index 043871a8c..ffb341fc4 100644 --- a/cmd/podman/images/list.go +++ b/cmd/podman/images/list.go @@ -184,13 +184,26 @@ func sortImages(imageS []*entities.ImageSummary) ([]imageReporter, error) { for _, e := range imageS { var h imageReporter if len(e.RepoTags) > 0 { + tagged := []imageReporter{} + untagged := []imageReporter{} for _, tag := range e.RepoTags { h.ImageSummary = *e h.Repository, h.Tag, err = tokenRepoTag(tag) if err != nil { return nil, errors.Wrapf(err, "error parsing repository tag %q:", tag) } - imgs = append(imgs, h) + if h.Tag == "<none>" { + untagged = append(untagged, h) + } else { + tagged = append(tagged, h) + } + } + // Note: we only want to display "<none>" if we + // couldn't find any tagged name in RepoTags. + if len(tagged) > 0 { + imgs = append(imgs, tagged...) + } else { + imgs = append(imgs, untagged[0]) } } else { h.ImageSummary = *e diff --git a/cmd/podman/images/pull.go b/cmd/podman/images/pull.go index d86f9800c..448543b4d 100644 --- a/cmd/podman/images/pull.go +++ b/cmd/podman/images/pull.go @@ -44,10 +44,10 @@ var ( // child of the images command. imagesPullCmd = &cobra.Command{ Use: pullCmd.Use, + Args: pullCmd.Args, Short: pullCmd.Short, Long: pullCmd.Long, RunE: pullCmd.RunE, - Args: cobra.ExactArgs(1), Example: `podman image pull imageName podman image pull fedora:latest`, } @@ -77,8 +77,6 @@ func init() { // pullFlags set the flags for the pull command. func pullFlags(flags *pflag.FlagSet) { flags.BoolVar(&pullOptions.AllTags, "all-tags", false, "All tagged images in the repository will be pulled") - flags.StringVar(&pullOptions.Authfile, "authfile", auth.GetDefaultAuthFile(), "Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override") - flags.StringVar(&pullOptions.CertDir, "cert-dir", "", "`Pathname` of a directory containing TLS certificates and keys") flags.StringVar(&pullOptions.CredentialsCLI, "creds", "", "`Credentials` (USERNAME:PASSWORD) to use for authenticating to a registry") flags.StringVar(&pullOptions.OverrideArch, "override-arch", "", "Use `ARCH` instead of the architecture of the machine for choosing images") flags.StringVar(&pullOptions.OverrideOS, "override-os", "", "Use `OS` instead of the running OS for choosing images") @@ -86,12 +84,11 @@ func pullFlags(flags *pflag.FlagSet) { flags.Bool("disable-content-trust", false, "This is a Docker specific option and is a NOOP") flags.BoolVarP(&pullOptions.Quiet, "quiet", "q", false, "Suppress output information when pulling images") flags.StringVar(&pullOptions.SignaturePolicy, "signature-policy", "", "`Pathname` of signature policy file (not usually used)") - flags.BoolVar(&pullOptions.TLSVerifyCLI, "tls-verify", true, "Require HTTPS and verify certificates when contacting registries") - if registry.IsRemote() { - _ = flags.MarkHidden("authfile") - _ = flags.MarkHidden("cert-dir") - _ = flags.MarkHidden("tls-verify") + if !registry.IsRemote() { + flags.StringVar(&pullOptions.Authfile, "authfile", auth.GetDefaultAuthFile(), "Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override") + flags.StringVar(&pullOptions.CertDir, "cert-dir", "", "`Pathname` of a directory containing TLS certificates and keys") + flags.BoolVar(&pullOptions.TLSVerifyCLI, "tls-verify", true, "Require HTTPS and verify certificates when contacting registries") } _ = flags.MarkHidden("signature-policy") } diff --git a/cmd/podman/images/save.go b/cmd/podman/images/save.go index c57f61221..b164a2534 100644 --- a/cmd/podman/images/save.go +++ b/cmd/podman/images/save.go @@ -94,6 +94,7 @@ func save(cmd *cobra.Command, args []string) (finalErr error) { return errors.Errorf("--compress can only be set when --format is either 'oci-dir' or 'docker-dir'") } if len(saveOpts.Output) == 0 { + saveOpts.Quiet = true fi := os.Stdout if terminal.IsTerminal(int(fi.Fd())) { return errors.Errorf("refusing to save to terminal. Use -o flag or redirect") @@ -122,12 +123,6 @@ func save(cmd *cobra.Command, args []string) (finalErr error) { tags = args[1:] } - // Decide whether c/image's progress bars should use stderr or stdout. - // If the output is set of stdout, any log message there would corrupt - // the tarfile. - if saveOpts.Output == os.Stdout.Name() { - saveOpts.Quiet = true - } err := registry.ImageEngine().Save(context.Background(), args[0], tags, saveOpts) if err == nil { succeeded = true |