[Techinal Debt] Cleanup ABI vs. Tunnel CLI commands

[NO TESTS NEEDED]

This commit cleans up two issues:
* Most commands support all EngineModes so default to that. Let
  outlayers declare their intent.
* Use cobra.Annotations to set supported EngineMode. This simplies
  instantiating commands as there is now one method to communicate a
  commands requirements rather than two.
* Combined aliased commands into one file
* Fixed aliased commands where Args field did not match
* Updated examples in README.md for writing commands
* Remove redundant flag DisableFlagsInUseLine in cobra.Command
  initialization.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
This commit is contained in:
Jhon Honce 2021-05-18 11:23:25 -07:00
parent 4f4a440afd
commit 33944cefe7
148 changed files with 266 additions and 509 deletions

View File

@ -40,9 +40,6 @@ var (
func init() { func init() {
// Subscribe command to podman // Subscribe command to podman
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
// _podman manifest_ will support both ABIMode and TunnelMode
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
// The definition for this command
Command: manifestCmd, Command: manifestCmd,
}) })
} }
@ -83,9 +80,6 @@ var (
func init() { func init() {
// Subscribe inspect sub command to manifest command // Subscribe inspect sub command to manifest command
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
// _podman manifest inspect_ will support both ABIMode and TunnelMode
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
// The definition for this command
Command: inspectCmd, Command: inspectCmd,
// The parent command to proceed this command on the CLI // The parent command to proceed this command on the CLI
Parent: manifestCmd, Parent: manifestCmd,

View File

@ -21,6 +21,7 @@ var (
or similar units that create new containers in order to run the updated images. or similar units that create new containers in order to run the updated images.
Please refer to the podman-auto-update(1) man page for details.` Please refer to the podman-auto-update(1) man page for details.`
autoUpdateCommand = &cobra.Command{ autoUpdateCommand = &cobra.Command{
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
Use: "auto-update [options]", Use: "auto-update [options]",
Short: "Auto update containers according to their auto-update policy", Short: "Auto update containers according to their auto-update policy",
Long: autoUpdateDescription, Long: autoUpdateDescription,
@ -33,7 +34,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Command: autoUpdateCommand, Command: autoUpdateCommand,
}) })

View File

@ -8,7 +8,6 @@ import (
commonComp "github.com/containers/common/pkg/completion" commonComp "github.com/containers/common/pkg/completion"
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -39,7 +38,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: completionCmd, Command: completionCmd,
}) })
flags := completionCmd.Flags() flags := completionCmd.Flags()

View File

@ -55,14 +55,12 @@ func attachFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: attachCommand, Command: attachCommand,
}) })
attachFlags(attachCommand) attachFlags(attachCommand)
validate.AddLatestFlag(attachCommand, &attachOpts.Latest) validate.AddLatestFlag(attachCommand, &attachOpts.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerAttachCommand, Command: containerAttachCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -42,7 +42,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: checkpointCommand, Command: checkpointCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -21,10 +21,11 @@ var (
Cleans up mount points and network stacks on one or more containers from the host. The container name or ID can be used. This command is used internally when running containers, but can also be used if container cleanup has failed when a container exits. Cleans up mount points and network stacks on one or more containers from the host. The container name or ID can be used. This command is used internally when running containers, but can also be used if container cleanup has failed when a container exits.
` `
cleanupCommand = &cobra.Command{ cleanupCommand = &cobra.Command{
Use: "cleanup [options] CONTAINER [CONTAINER...]", Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
Short: "Cleanup network and mountpoints of one or more containers", Use: "cleanup [options] CONTAINER [CONTAINER...]",
Long: cleanupDescription, Short: "Cleanup network and mountpoints of one or more containers",
RunE: cleanup, Long: cleanupDescription,
RunE: cleanup,
Args: func(cmd *cobra.Command, args []string) error { Args: func(cmd *cobra.Command, args []string) error {
return validate.CheckAllLatestAndCIDFile(cmd, args, false, false) return validate.CheckAllLatestAndCIDFile(cmd, args, false, false)
}, },
@ -41,7 +42,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Parent: containerCmd, Parent: containerCmd,
Command: cleanupCommand, Command: cleanupCommand,
}) })

View File

@ -82,13 +82,11 @@ func commitFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: commitCommand, Command: commitCommand,
}) })
commitFlags(commitCommand) commitFlags(commitCommand)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerCommitCommand, Command: containerCommitCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -3,7 +3,6 @@ package containers
import ( import (
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/cmd/podman/validate"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/util" "github.com/containers/podman/v3/pkg/util"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -26,7 +25,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerCmd, Command: containerCmd,
}) })
} }

View File

@ -62,13 +62,11 @@ func cpFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: cpCommand, Command: cpCommand,
}) })
cpFlags(cpCommand) cpFlags(cpCommand)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerCpCommand, Command: containerCpCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -39,7 +39,7 @@ var (
} }
containerCreateCommand = &cobra.Command{ containerCreateCommand = &cobra.Command{
Args: cobra.MinimumNArgs(1), Args: createCommand.Args,
Use: createCommand.Use, Use: createCommand.Use,
Short: createCommand.Short, Short: createCommand.Short,
Long: createCommand.Long, Long: createCommand.Long,
@ -72,13 +72,11 @@ func createFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: createCommand, Command: createCommand,
}) })
createFlags(createCommand) createFlags(createCommand)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerCreateCommand, Command: containerCreateCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -27,7 +27,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: diffCmd, Command: diffCmd,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -21,24 +21,22 @@ var (
execDescription = `Execute the specified command inside a running container. execDescription = `Execute the specified command inside a running container.
` `
execCommand = &cobra.Command{ execCommand = &cobra.Command{
Use: "exec [options] CONTAINER [COMMAND [ARG...]]", Use: "exec [options] CONTAINER [COMMAND [ARG...]]",
Short: "Run a process in a running container", Short: "Run a process in a running container",
Long: execDescription, Long: execDescription,
RunE: exec, RunE: exec,
DisableFlagsInUseLine: true, ValidArgsFunction: common.AutocompleteExecCommand,
ValidArgsFunction: common.AutocompleteExecCommand,
Example: `podman exec -it ctrID ls Example: `podman exec -it ctrID ls
podman exec -it -w /tmp myCtr pwd podman exec -it -w /tmp myCtr pwd
podman exec --user root ctrID ls`, podman exec --user root ctrID ls`,
} }
containerExecCommand = &cobra.Command{ containerExecCommand = &cobra.Command{
Use: execCommand.Use, Use: execCommand.Use,
Short: execCommand.Short, Short: execCommand.Short,
Long: execCommand.Long, Long: execCommand.Long,
RunE: execCommand.RunE, RunE: execCommand.RunE,
DisableFlagsInUseLine: true, ValidArgsFunction: execCommand.ValidArgsFunction,
ValidArgsFunction: execCommand.ValidArgsFunction,
Example: `podman container exec -it ctrID ls Example: `podman container exec -it ctrID ls
podman container exec -it -w /tmp myCtr pwd podman container exec -it -w /tmp myCtr pwd
podman container exec --user root ctrID ls`, podman container exec --user root ctrID ls`,
@ -92,14 +90,12 @@ func execFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: execCommand, Command: execCommand,
}) })
execFlags(execCommand) execFlags(execCommand)
validate.AddLatestFlag(execCommand, &execOpts.Latest) validate.AddLatestFlag(execCommand, &execOpts.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerExecCommand, Command: containerExecCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -18,16 +18,14 @@ var (
Long: containerExistsDescription, Long: containerExistsDescription,
Example: `podman container exists --external containerID Example: `podman container exists --external containerID
podman container exists myctr || podman run --name myctr [etc...]`, podman container exists myctr || podman run --name myctr [etc...]`,
RunE: exists, RunE: exists,
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
DisableFlagsInUseLine: true, ValidArgsFunction: common.AutocompleteContainers,
ValidArgsFunction: common.AutocompleteContainers,
} }
) )
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: existsCommand, Command: existsCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -55,13 +55,11 @@ func exportFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: exportCommand, Command: exportCommand,
}) })
exportFlags(exportCommand) exportFlags(exportCommand)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerExportCommand, Command: containerExportCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -52,7 +52,6 @@ func initFlags(flags *pflag.FlagSet) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: initCommand, Command: initCommand,
}) })
flags := initCommand.Flags() flags := initCommand.Flags()
@ -60,7 +59,6 @@ func init() {
validate.AddLatestFlag(initCommand, &initOptions.Latest) validate.AddLatestFlag(initCommand, &initOptions.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Parent: containerCmd, Parent: containerCmd,
Command: containerInitCommand, Command: containerInitCommand,
}) })

View File

@ -26,7 +26,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: inspectCmd, Command: inspectCmd,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -67,14 +67,12 @@ func killFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: killCommand, Command: killCommand,
}) })
killFlags(killCommand) killFlags(killCommand)
validate.AddLatestFlag(killCommand, &killOptions.Latest) validate.AddLatestFlag(killCommand, &killOptions.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerKillCommand, Command: containerKillCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -4,7 +4,6 @@ import (
"github.com/containers/common/pkg/completion" "github.com/containers/common/pkg/completion"
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/cmd/podman/validate"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -26,7 +25,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: listCmd, Command: listCmd,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -77,7 +77,6 @@ func init() {
// logs // logs
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: logsCommand, Command: logsCommand,
}) })
logsFlags(logsCommand) logsFlags(logsCommand)
@ -85,7 +84,6 @@ func init() {
// container logs // container logs
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerLogsCommand, Command: containerLogsCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -25,6 +25,11 @@ var (
` `
mountCommand = &cobra.Command{ mountCommand = &cobra.Command{
Annotations: map[string]string{
registry.UnshareNSRequired: "",
registry.ParentNSRequired: "",
registry.EngineMode: registry.ABIMode,
},
Use: "mount [options] [CONTAINER...]", Use: "mount [options] [CONTAINER...]",
Short: "Mount a working container's root filesystem", Short: "Mount a working container's root filesystem",
Long: mountDescription, Long: mountDescription,
@ -32,20 +37,16 @@ var (
Args: func(cmd *cobra.Command, args []string) error { Args: func(cmd *cobra.Command, args []string) error {
return validate.CheckAllLatestAndCIDFile(cmd, args, true, false) return validate.CheckAllLatestAndCIDFile(cmd, args, true, false)
}, },
Annotations: map[string]string{
registry.UnshareNSRequired: "",
registry.ParentNSRequired: "",
},
ValidArgsFunction: common.AutocompleteContainers, ValidArgsFunction: common.AutocompleteContainers,
} }
containerMountCommand = &cobra.Command{ containerMountCommand = &cobra.Command{
Annotations: mountCommand.Annotations,
Use: mountCommand.Use, Use: mountCommand.Use,
Short: mountCommand.Short, Short: mountCommand.Short,
Long: mountCommand.Long, Long: mountCommand.Long,
RunE: mountCommand.RunE, RunE: mountCommand.RunE,
Args: mountCommand.Args, Args: mountCommand.Args,
Annotations: mountCommand.Annotations,
ValidArgsFunction: mountCommand.ValidArgsFunction, ValidArgsFunction: mountCommand.ValidArgsFunction,
} }
) )
@ -68,14 +69,12 @@ func mountFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Command: mountCommand, Command: mountCommand,
}) })
mountFlags(mountCommand) mountFlags(mountCommand)
validate.AddLatestFlag(mountCommand, &mountOpts.Latest) validate.AddLatestFlag(mountCommand, &mountOpts.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Command: containerMountCommand, Command: containerMountCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -48,14 +48,12 @@ func pauseFlags(flags *pflag.FlagSet) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: pauseCommand, Command: pauseCommand,
}) })
flags := pauseCommand.Flags() flags := pauseCommand.Flags()
pauseFlags(flags) pauseFlags(flags)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerPauseCommand, Command: containerPauseCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -56,14 +56,12 @@ func portFlags(flags *pflag.FlagSet) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: portCommand, Command: portCommand,
}) })
portFlags(portCommand.Flags()) portFlags(portCommand.Flags())
validate.AddLatestFlag(portCommand, &portOpts.Latest) validate.AddLatestFlag(portCommand, &portOpts.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerPortCommand, Command: containerPortCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -35,7 +35,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: pruneCommand, Command: pruneCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -60,14 +60,12 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: psCommand, Command: psCommand,
}) })
listFlagSet(psCommand) listFlagSet(psCommand)
validate.AddLatestFlag(psCommand, &listOpts.Latest) validate.AddLatestFlag(psCommand, &listOpts.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: psContainerCommand, Command: psContainerCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -33,12 +33,10 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: renameCommand, Command: renameCommand,
}) })
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerRenameCommand, Command: containerRenameCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -39,6 +39,7 @@ var (
Short: restartCommand.Short, Short: restartCommand.Short,
Long: restartCommand.Long, Long: restartCommand.Long,
RunE: restartCommand.RunE, RunE: restartCommand.RunE,
Args: restartCommand.Args,
ValidArgsFunction: restartCommand.ValidArgsFunction, ValidArgsFunction: restartCommand.ValidArgsFunction,
Example: `podman container restart ctrID Example: `podman container restart ctrID
podman container restart --latest podman container restart --latest
@ -66,14 +67,12 @@ func restartFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: restartCommand, Command: restartCommand,
}) })
restartFlags(restartCommand) restartFlags(restartCommand)
validate.AddLatestFlag(restartCommand, &restartOptions.Latest) validate.AddLatestFlag(restartCommand, &restartOptions.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerRestartCommand, Command: containerRestartCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -42,7 +42,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: restoreCommand, Command: restoreCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -38,13 +38,11 @@ var (
} }
containerRmCommand = &cobra.Command{ containerRmCommand = &cobra.Command{
Use: rmCommand.Use, Use: rmCommand.Use,
Short: rmCommand.Short, Short: rmCommand.Short,
Long: rmCommand.Long, Long: rmCommand.Long,
RunE: rmCommand.RunE, RunE: rmCommand.RunE,
Args: func(cmd *cobra.Command, args []string) error { Args: rmCommand.Args,
return validate.CheckAllLatestAndCIDFile(cmd, args, false, true)
},
ValidArgsFunction: rmCommand.ValidArgsFunction, ValidArgsFunction: rmCommand.ValidArgsFunction,
Example: `podman container rm imageID Example: `podman container rm imageID
podman container rm mywebserver myflaskserver 860a4b23 podman container rm mywebserver myflaskserver 860a4b23
@ -79,14 +77,12 @@ func rmFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: rmCommand, Command: rmCommand,
}) })
rmFlags(rmCommand) rmFlags(rmCommand)
validate.AddLatestFlag(rmCommand, &rmOptions.Latest) validate.AddLatestFlag(rmCommand, &rmOptions.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerRmCommand, Command: containerRmCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -91,14 +91,12 @@ func runFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: runCommand, Command: runCommand,
}) })
runFlags(runCommand) runFlags(runCommand)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerRunCommand, Command: containerRunCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -25,6 +25,7 @@ var (
runlabelOptions = runlabelOptionsWrapper{} runlabelOptions = runlabelOptionsWrapper{}
runlabelDescription = "Executes a command as described by a container image label." runlabelDescription = "Executes a command as described by a container image label."
runlabelCommand = &cobra.Command{ runlabelCommand = &cobra.Command{
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
Use: "runlabel [options] LABEL IMAGE [ARG...]", Use: "runlabel [options] LABEL IMAGE [ARG...]",
Short: "Execute the command described by an image label", Short: "Execute the command described by an image label",
Long: runlabelDescription, Long: runlabelDescription,
@ -39,7 +40,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Command: runlabelCommand, Command: runlabelCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -70,14 +70,12 @@ func startFlags(cmd *cobra.Command) {
} }
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: startCommand, Command: startCommand,
}) })
startFlags(startCommand) startFlags(startCommand)
validate.AddLatestFlag(startCommand, &startOptions.Latest) validate.AddLatestFlag(startCommand, &startOptions.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerStartCommand, Command: containerStartCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -79,14 +79,12 @@ func statFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: statsCommand, Command: statsCommand,
}) })
statFlags(statsCommand) statFlags(statsCommand)
validate.AddLatestFlag(statsCommand, &statsOptions.Latest) validate.AddLatestFlag(statsCommand, &statsOptions.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerStatsCommand, Command: containerStatsCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -78,14 +78,12 @@ func stopFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: stopCommand, Command: stopCommand,
}) })
stopFlags(stopCommand) stopFlags(stopCommand)
validate.AddLatestFlag(stopCommand, &stopOptions.Latest) validate.AddLatestFlag(stopCommand, &stopOptions.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerStopCommand, Command: containerStopCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -58,7 +58,6 @@ func topFlags(flags *pflag.FlagSet) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: topCommand, Command: topCommand,
}) })
topFlags(topCommand.Flags()) topFlags(topCommand.Flags())
@ -71,7 +70,6 @@ func init() {
} }
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerTopCommand, Command: containerTopCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -20,11 +20,12 @@ var (
An unmount can be forced with the --force flag. An unmount can be forced with the --force flag.
` `
unmountCommand = &cobra.Command{ unmountCommand = &cobra.Command{
Use: "unmount [options] CONTAINER [CONTAINER...]", Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
Aliases: []string{"umount"}, Use: "unmount [options] CONTAINER [CONTAINER...]",
Short: "Unmounts working container's root filesystem", Aliases: []string{"umount"},
Long: description, Short: "Unmounts working container's root filesystem",
RunE: unmount, Long: description,
RunE: unmount,
Args: func(cmd *cobra.Command, args []string) error { Args: func(cmd *cobra.Command, args []string) error {
return validate.CheckAllLatestAndCIDFile(cmd, args, false, false) return validate.CheckAllLatestAndCIDFile(cmd, args, false, false)
}, },
@ -35,11 +36,12 @@ var (
} }
containerUnmountCommand = &cobra.Command{ containerUnmountCommand = &cobra.Command{
Use: unmountCommand.Use, Annotations: unmountCommand.Annotations,
Short: unmountCommand.Short, Use: unmountCommand.Use,
Aliases: unmountCommand.Aliases, Short: unmountCommand.Short,
Long: unmountCommand.Long, Aliases: unmountCommand.Aliases,
RunE: unmountCommand.RunE, Long: unmountCommand.Long,
RunE: unmountCommand.RunE,
Args: func(cmd *cobra.Command, args []string) error { Args: func(cmd *cobra.Command, args []string) error {
return validate.CheckAllLatestAndCIDFile(cmd, args, false, false) return validate.CheckAllLatestAndCIDFile(cmd, args, false, false)
}, },
@ -61,14 +63,12 @@ func unmountFlags(flags *pflag.FlagSet) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Command: unmountCommand, Command: unmountCommand,
}) })
unmountFlags(unmountCommand.Flags()) unmountFlags(unmountCommand.Flags())
validate.AddLatestFlag(unmountCommand, &unmountOpts.Latest) validate.AddLatestFlag(unmountCommand, &unmountOpts.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Command: containerUnmountCommand, Command: containerUnmountCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -45,14 +45,12 @@ func unpauseFlags(flags *pflag.FlagSet) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: unpauseCommand, Command: unpauseCommand,
}) })
flags := unpauseCommand.Flags() flags := unpauseCommand.Flags()
unpauseFlags(flags) unpauseFlags(flags)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerUnpauseCommand, Command: containerUnpauseCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -60,14 +60,12 @@ func waitFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: waitCommand, Command: waitCommand,
}) })
waitFlags(waitCommand) waitFlags(waitCommand)
validate.AddLatestFlag(waitCommand, &waitOptions.Latest) validate.AddLatestFlag(waitCommand, &waitOptions.Latest)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerWaitCommand, Command: containerWaitCommand,
Parent: containerCmd, Parent: containerCmd,
}) })

View File

@ -34,7 +34,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: diffCmd, Command: diffCmd,
}) })
flags := diffCmd.Flags() flags := diffCmd.Flags()

View File

@ -3,7 +3,6 @@ package pods
import ( import (
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/cmd/podman/validate"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/util" "github.com/containers/podman/v3/pkg/util"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -21,7 +20,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: generateCmd, Command: generateCmd,
}) })
} }

View File

@ -38,7 +38,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: kubeCmd, Command: kubeCmd,
Parent: generateCmd, Parent: generateCmd,
}) })

View File

@ -40,7 +40,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: systemdCmd, Command: systemdCmd,
Parent: generateCmd, Parent: generateCmd,
}) })

View File

@ -3,12 +3,10 @@ package healthcheck
import ( import (
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/cmd/podman/validate"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var ( var (
// Command: healthcheck
healthCmd = &cobra.Command{ healthCmd = &cobra.Command{
Use: "healthcheck", Use: "healthcheck",
Short: "Manage health checks on containers", Short: "Manage health checks on containers",
@ -19,7 +17,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: healthCmd, Command: healthCmd,
}) })
} }

View File

@ -11,23 +11,20 @@ import (
) )
var ( var (
healthcheckRunDescription = "run the health check of a container" runCmd = &cobra.Command{
healthcheckrunCommand = &cobra.Command{ Use: "run CONTAINER",
Use: "run CONTAINER", Short: "run the health check of a container",
Short: "run the health check of a container", Long: "run the health check of a container",
Long: healthcheckRunDescription, Example: `podman healthcheck run mywebapp`,
Example: `podman healthcheck run mywebapp`, RunE: run,
RunE: run, Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1), ValidArgsFunction: common.AutocompleteContainersRunning,
ValidArgsFunction: common.AutocompleteContainersRunning,
DisableFlagsInUseLine: true,
} }
) )
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: runCmd,
Command: healthcheckrunCommand,
Parent: healthCmd, Parent: healthCmd,
}) })
} }

View File

@ -82,14 +82,11 @@ func useLayers() string {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: buildCmd, Command: buildCmd,
}) })
buildFlags(buildCmd) buildFlags(buildCmd)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: imageBuildCmd, Command: imageBuildCmd,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -27,7 +27,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: diffCmd, Command: diffCmd,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -3,7 +3,6 @@ package images
import ( import (
"github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -17,13 +16,11 @@ var (
ValidArgsFunction: common.AutocompleteImages, ValidArgsFunction: common.AutocompleteImages,
Example: `podman image exists ID Example: `podman image exists ID
podman image exists IMAGE && podman pull IMAGE`, podman image exists IMAGE && podman pull IMAGE`,
DisableFlagsInUseLine: true,
} }
) )
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: existsCmd, Command: existsCmd,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -56,13 +56,11 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: historyCmd, Command: historyCmd,
}) })
historyFlags(historyCmd) historyFlags(historyCmd)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: imageHistoryCmd, Command: imageHistoryCmd,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -3,7 +3,6 @@ package images
import ( import (
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/cmd/podman/validate"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -22,7 +21,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: imageCmd, Command: imageCmd,
}) })
} }

View File

@ -1,32 +0,0 @@
package images
import (
"strings"
"github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra"
)
var (
// podman _images_ Alias for podman image _list_
imagesCmd = &cobra.Command{
Use: strings.Replace(listCmd.Use, "list", "images", 1),
Args: listCmd.Args,
Short: listCmd.Short,
Long: listCmd.Long,
RunE: listCmd.RunE,
ValidArgsFunction: listCmd.ValidArgsFunction,
Example: strings.Replace(listCmd.Example, "podman image list", "podman images", -1),
DisableFlagsInUseLine: true,
}
)
func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: imagesCmd,
})
imageListFlagSet(imagesCmd)
}

View File

@ -51,13 +51,11 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: importCommand, Command: importCommand,
}) })
importFlags(importCommand) importFlags(importCommand)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: imageImportCommand, Command: imageImportCommand,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -26,7 +26,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: inspectCmd, Command: inspectCmd,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -34,8 +34,7 @@ type listFlagType struct {
} }
var ( var (
// Command: podman image _list_ imageListCmd = &cobra.Command{
listCmd = &cobra.Command{
Use: "list [options] [IMAGE]", Use: "list [options] [IMAGE]",
Aliases: []string{"ls"}, Aliases: []string{"ls"},
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
@ -46,7 +45,18 @@ var (
Example: `podman image list --format json Example: `podman image list --format json
podman image list --sort repository --format "table {{.ID}} {{.Repository}} {{.Tag}}" podman image list --sort repository --format "table {{.ID}} {{.Repository}} {{.Tag}}"
podman image list --filter dangling=true`, podman image list --filter dangling=true`,
DisableFlagsInUseLine: true, }
imagesCmd = &cobra.Command{
Use: "images [options] [IMAGE]",
Args: imageListCmd.Args,
Short: imageListCmd.Short,
Long: imageListCmd.Long,
RunE: imageListCmd.RunE,
ValidArgsFunction: imageListCmd.ValidArgsFunction,
Example: `podman images --format json
podman images --sort repository --format "table {{.ID}} {{.Repository}} {{.Tag}}"
podman images --filter dangling=true`,
} }
// Options to pull data // Options to pull data
@ -65,11 +75,15 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: imageListCmd,
Command: listCmd,
Parent: imageCmd, Parent: imageCmd,
}) })
imageListFlagSet(listCmd) imageListFlagSet(imageListCmd)
registry.Commands = append(registry.Commands, registry.CliCommand{
Command: imagesCmd,
})
imageListFlagSet(imagesCmd)
} }
func imageListFlagSet(cmd *cobra.Command) { func imageListFlagSet(cmd *cobra.Command) {

View File

@ -45,12 +45,10 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: loadCommand, Command: loadCommand,
}) })
loadFlags(loadCommand) loadFlags(loadCommand)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: imageLoadCommand, Command: imageLoadCommand,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -24,6 +24,11 @@ var (
` `
mountCommand = &cobra.Command{ mountCommand = &cobra.Command{
Annotations: map[string]string{
registry.UnshareNSRequired: "",
registry.ParentNSRequired: "",
registry.EngineMode: registry.ABIMode,
},
Use: "mount [options] [IMAGE...]", Use: "mount [options] [IMAGE...]",
Short: "Mount an image's root filesystem", Short: "Mount an image's root filesystem",
Long: mountDescription, Long: mountDescription,
@ -33,10 +38,6 @@ var (
podman image mount imgID1 imgID2 imgID3 podman image mount imgID1 imgID2 imgID3
podman image mount podman image mount
podman image mount --all`, podman image mount --all`,
Annotations: map[string]string{
registry.UnshareNSRequired: "",
registry.ParentNSRequired: "",
},
} }
) )
@ -56,7 +57,6 @@ func mountFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Command: mountCommand, Command: mountCommand,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -34,7 +34,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: pruneCmd, Command: pruneCmd,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -60,14 +60,12 @@ var (
func init() { func init() {
// pull // pull
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: pullCmd, Command: pullCmd,
}) })
pullFlags(pullCmd) pullFlags(pullCmd)
// images pull // images pull
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: imagesPullCmd, Command: imagesPullCmd,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -57,14 +57,12 @@ var (
func init() { func init() {
// push // push
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: pushCmd, Command: pushCmd,
}) })
pushFlags(pushCmd) pushFlags(pushCmd)
// images push // images push
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: imagePushCmd, Command: imagePushCmd,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -25,17 +25,33 @@ var (
podman image rm c4dfb1609ee2 93fd78260bd1 c0ed59d05ff7`, podman image rm c4dfb1609ee2 93fd78260bd1 c0ed59d05ff7`,
} }
rmiCmd = &cobra.Command{
Use: "rmi [options] IMAGE [IMAGE...]",
Args: rmCmd.Args,
Short: rmCmd.Short,
Long: rmCmd.Long,
RunE: rmCmd.RunE,
ValidArgsFunction: rmCmd.ValidArgsFunction,
Example: `podman rmi imageID
podman rmi --force alpine
podman rmi c4dfb1609ee2 93fd78260bd1 c0ed59d05ff7`,
}
imageOpts = entities.ImageRemoveOptions{} imageOpts = entities.ImageRemoveOptions{}
) )
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: rmCmd, Command: rmCmd,
Parent: imageCmd, Parent: imageCmd,
}) })
imageRemoveFlagSet(rmCmd.Flags()) imageRemoveFlagSet(rmCmd.Flags())
registry.Commands = append(registry.Commands, registry.CliCommand{
Command: rmiCmd,
})
imageRemoveFlagSet(rmiCmd.Flags())
} }
func imageRemoveFlagSet(flags *pflag.FlagSet) { func imageRemoveFlagSet(flags *pflag.FlagSet) {

View File

@ -1,29 +0,0 @@
package images
import (
"strings"
"github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra"
)
var (
rmiCmd = &cobra.Command{
Use: strings.Replace(rmCmd.Use, "rm ", "rmi ", 1),
Args: rmCmd.Args,
Short: rmCmd.Short,
Long: rmCmd.Long,
RunE: rmCmd.RunE,
ValidArgsFunction: rmCmd.ValidArgsFunction,
Example: strings.Replace(rmCmd.Example, "podman image rm", "podman rmi", -1),
}
)
func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: rmiCmd,
})
imageRemoveFlagSet(rmiCmd.Flags())
}

View File

@ -48,6 +48,7 @@ var (
podman save --format docker-dir -o ubuntu-dir ubuntu podman save --format docker-dir -o ubuntu-dir ubuntu
podman save > alpine-all.tar alpine:latest`, podman save > alpine-all.tar alpine:latest`,
} }
imageSaveCommand = &cobra.Command{ imageSaveCommand = &cobra.Command{
Args: saveCommand.Args, Args: saveCommand.Args,
Use: saveCommand.Use, Use: saveCommand.Use,
@ -67,13 +68,11 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: saveCommand, Command: saveCommand,
}) })
saveFlags(saveCommand) saveFlags(saveCommand)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: imageSaveCommand, Command: imageSaveCommand,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -38,7 +38,6 @@ var (
Users can limit the number of results, and filter the output based on certain conditions.` Users can limit the number of results, and filter the output based on certain conditions.`
// Command: podman search
searchCmd = &cobra.Command{ searchCmd = &cobra.Command{
Use: "search [options] TERM", Use: "search [options] TERM",
Short: "Search registry for image", Short: "Search registry for image",
@ -51,14 +50,12 @@ var (
podman search --format "table {{.Index}} {{.Name}}" registry.fedoraproject.org/fedora`, podman search --format "table {{.Index}} {{.Name}}" registry.fedoraproject.org/fedora`,
} }
// Command: podman image search
imageSearchCmd = &cobra.Command{ imageSearchCmd = &cobra.Command{
Use: searchCmd.Use, Use: searchCmd.Use,
Short: searchCmd.Short, Short: searchCmd.Short,
Long: searchCmd.Long, Long: searchCmd.Long,
RunE: searchCmd.RunE, RunE: searchCmd.RunE,
Args: searchCmd.Args, Args: searchCmd.Args,
Annotations: searchCmd.Annotations,
ValidArgsFunction: searchCmd.ValidArgsFunction, ValidArgsFunction: searchCmd.ValidArgsFunction,
Example: `podman image search --filter=is-official --limit 3 alpine Example: `podman image search --filter=is-official --limit 3 alpine
podman image search registry.fedoraproject.org/ # only works with v2 registries podman image search registry.fedoraproject.org/ # only works with v2 registries
@ -67,16 +64,12 @@ var (
) )
func init() { func init() {
// search
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: searchCmd, Command: searchCmd,
}) })
searchFlags(searchCmd) searchFlags(searchCmd)
// images search
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: imageSearchCmd, Command: imageSearchCmd,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -14,6 +14,7 @@ import (
var ( var (
signDescription = "Create a signature file that can be used later to verify the image." signDescription = "Create a signature file that can be used later to verify the image."
signCommand = &cobra.Command{ signCommand = &cobra.Command{
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
Use: "sign [options] IMAGE [IMAGE...]", Use: "sign [options] IMAGE [IMAGE...]",
Short: "Sign an image", Short: "Sign an image",
Long: signDescription, Long: signDescription,
@ -31,7 +32,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Command: signCommand, Command: signCommand,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -10,26 +10,24 @@ import (
var ( var (
tagDescription = "Adds one or more additional names to locally-stored image." tagDescription = "Adds one or more additional names to locally-stored image."
tagCommand = &cobra.Command{ tagCommand = &cobra.Command{
Use: "tag IMAGE TARGET_NAME [TARGET_NAME...]", Use: "tag IMAGE TARGET_NAME [TARGET_NAME...]",
Short: "Add an additional name to a local image", Short: "Add an additional name to a local image",
Long: tagDescription, Long: tagDescription,
RunE: tag, RunE: tag,
Args: cobra.MinimumNArgs(2), Args: cobra.MinimumNArgs(2),
DisableFlagsInUseLine: true, ValidArgsFunction: common.AutocompleteImages,
ValidArgsFunction: common.AutocompleteImages,
Example: `podman tag 0e3bbc2 fedora:latest Example: `podman tag 0e3bbc2 fedora:latest
podman tag imageID:latest myNewImage:newTag podman tag imageID:latest myNewImage:newTag
podman tag httpd myregistryhost:5000/fedora/httpd:v2`, podman tag httpd myregistryhost:5000/fedora/httpd:v2`,
} }
imageTagCommand = &cobra.Command{ imageTagCommand = &cobra.Command{
Args: tagCommand.Args, Args: tagCommand.Args,
DisableFlagsInUseLine: true, Use: tagCommand.Use,
Use: tagCommand.Use, Short: tagCommand.Short,
Short: tagCommand.Short, Long: tagCommand.Long,
Long: tagCommand.Long, RunE: tagCommand.RunE,
RunE: tagCommand.RunE, ValidArgsFunction: tagCommand.ValidArgsFunction,
ValidArgsFunction: tagCommand.ValidArgsFunction,
Example: `podman image tag 0e3bbc2 fedora:latest Example: `podman image tag 0e3bbc2 fedora:latest
podman image tag imageID:latest myNewImage:newTag podman image tag imageID:latest myNewImage:newTag
podman image tag httpd myregistryhost:5000/fedora/httpd:v2`, podman image tag httpd myregistryhost:5000/fedora/httpd:v2`,
@ -38,11 +36,9 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: tagCommand, Command: tagCommand,
}) })
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: imageTagCommand, Command: imageTagCommand,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -25,7 +25,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: treeCmd, Command: treeCmd,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -3,7 +3,6 @@ package images
import ( import (
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/cmd/podman/validate"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -11,16 +10,16 @@ var (
trustDescription = `Manages which registries you trust as a source of container images based on their location. trustDescription = `Manages which registries you trust as a source of container images based on their location.
The location is determined by the transport and the registry host of the image. Using this container image docker://quay.io/podman/stable as an example, docker is the transport and quay.io is the registry host.` The location is determined by the transport and the registry host of the image. Using this container image docker://quay.io/podman/stable as an example, docker is the transport and quay.io is the registry host.`
trustCmd = &cobra.Command{ trustCmd = &cobra.Command{
Use: "trust", Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
Short: "Manage container image trust policy", Use: "trust",
Long: trustDescription, Short: "Manage container image trust policy",
RunE: validate.SubCommandExists, Long: trustDescription,
RunE: validate.SubCommandExists,
} }
) )
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Command: trustCmd, Command: trustCmd,
Parent: imageCmd, Parent: imageCmd,
}) })

View File

@ -16,6 +16,7 @@ import (
var ( var (
setTrustDescription = "Set default trust policy or add a new trust policy for a registry" setTrustDescription = "Set default trust policy or add a new trust policy for a registry"
setTrustCommand = &cobra.Command{ setTrustCommand = &cobra.Command{
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
Use: "set [options] REGISTRY", Use: "set [options] REGISTRY",
Short: "Set default trust policy or a new trust policy for a registry", Short: "Set default trust policy or a new trust policy for a registry",
Long: setTrustDescription, Long: setTrustDescription,
@ -32,7 +33,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Command: setTrustCommand, Command: setTrustCommand,
Parent: trustCmd, Parent: trustCmd,
}) })

View File

@ -15,6 +15,7 @@ import (
var ( var (
showTrustDescription = "Display trust policy for the system" showTrustDescription = "Display trust policy for the system"
showTrustCommand = &cobra.Command{ showTrustCommand = &cobra.Command{
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
Use: "show [options] [REGISTRY]", Use: "show [options] [REGISTRY]",
Short: "Display trust policy for the system", Short: "Display trust policy for the system",
Long: showTrustDescription, Long: showTrustDescription,
@ -31,7 +32,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Command: showTrustCommand, Command: showTrustCommand,
Parent: trustCmd, Parent: trustCmd,
}) })

View File

@ -20,6 +20,7 @@ var (
An unmount can be forced with the --force flag. An unmount can be forced with the --force flag.
` `
unmountCommand = &cobra.Command{ unmountCommand = &cobra.Command{
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
Use: "unmount [options] IMAGE [IMAGE...]", Use: "unmount [options] IMAGE [IMAGE...]",
Aliases: []string{"umount"}, Aliases: []string{"umount"},
Short: "Unmount an image's root filesystem", Short: "Unmount an image's root filesystem",
@ -43,7 +44,6 @@ func unmountFlags(flags *pflag.FlagSet) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Parent: imageCmd, Parent: imageCmd,
Command: unmountCommand, Command: unmountCommand,
}) })

View File

@ -8,27 +8,25 @@ import (
) )
var ( var (
untagCommand = &cobra.Command{ untagCmd = &cobra.Command{
Use: "untag IMAGE [IMAGE...]", Use: "untag IMAGE [IMAGE...]",
Short: "Remove a name from a local image", Short: "Remove a name from a local image",
Long: "Removes one or more names from a locally-stored image.", Long: "Removes one or more names from a locally-stored image.",
RunE: untag, RunE: untag,
Args: cobra.MinimumNArgs(1), Args: cobra.MinimumNArgs(1),
DisableFlagsInUseLine: true, ValidArgsFunction: common.AutocompleteImages,
ValidArgsFunction: common.AutocompleteImages,
Example: `podman untag 0e3bbc2 Example: `podman untag 0e3bbc2
podman untag imageID:latest otherImageName:latest podman untag imageID:latest otherImageName:latest
podman untag httpd myregistryhost:5000/fedora/httpd:v2`, podman untag httpd myregistryhost:5000/fedora/httpd:v2`,
} }
imageUntagCommand = &cobra.Command{ imageUntagCmd = &cobra.Command{
Args: untagCommand.Args, Args: untagCmd.Args,
DisableFlagsInUseLine: true, Use: untagCmd.Use,
Use: untagCommand.Use, Short: untagCmd.Short,
Short: untagCommand.Short, Long: untagCmd.Long,
Long: untagCommand.Long, RunE: untagCmd.RunE,
RunE: untagCommand.RunE, ValidArgsFunction: untagCmd.ValidArgsFunction,
ValidArgsFunction: untagCommand.ValidArgsFunction,
Example: `podman image untag 0e3bbc2 Example: `podman image untag 0e3bbc2
podman image untag imageID:latest otherImageName:latest podman image untag imageID:latest otherImageName:latest
podman image untag httpd myregistryhost:5000/fedora/httpd:v2`, podman image untag httpd myregistryhost:5000/fedora/httpd:v2`,
@ -37,12 +35,10 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: untagCmd,
Command: untagCommand,
}) })
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: imageUntagCmd,
Command: imageUntagCommand,
Parent: imageCmd, Parent: imageCmd,
}) })
} }

View File

@ -36,7 +36,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: inspectCmd, Command: inspectCmd,
}) })
inspectOpts = inspect.AddInspectFlagSet(inspectCmd) inspectOpts = inspect.AddInspectFlagSet(inspectCmd)

View File

@ -9,7 +9,6 @@ import (
"github.com/containers/image/v5/types" "github.com/containers/image/v5/types"
"github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/registries" "github.com/containers/podman/v3/pkg/registries"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -39,7 +38,6 @@ func init() {
// store credentials locally while the remote client will pass them // store credentials locally while the remote client will pass them
// over the wire to the endpoint. // over the wire to the endpoint.
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: loginCommand, Command: loginCommand,
}) })
flags := loginCommand.Flags() flags := loginCommand.Flags()

View File

@ -8,7 +8,6 @@ import (
"github.com/containers/image/v5/types" "github.com/containers/image/v5/types"
"github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/registries" "github.com/containers/podman/v3/pkg/registries"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -33,7 +32,6 @@ func init() {
// store credentials locally while the remote client will pass them // store credentials locally while the remote client will pass them
// over the wire to the endpoint. // over the wire to the endpoint.
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: logoutCommand, Command: logoutCommand,
}) })
flags := logoutCommand.Flags() flags := logoutCommand.Flags()

View File

@ -5,7 +5,6 @@ package machine
import ( import (
"github.com/containers/common/pkg/completion" "github.com/containers/common/pkg/completion"
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/machine" "github.com/containers/podman/v3/pkg/machine"
"github.com/containers/podman/v3/pkg/machine/qemu" "github.com/containers/podman/v3/pkg/machine/qemu"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -25,13 +24,12 @@ var (
) )
var ( var (
initOpts = machine.InitOptions{} initOpts = machine.InitOptions{}
defaultMachineName string = "podman-machine-default" defaultMachineName = "podman-machine-default"
) )
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: initCmd, Command: initCmd,
Parent: machineCmd, Parent: machineCmd,
}) })

View File

@ -15,7 +15,6 @@ import (
"github.com/containers/podman/v3/cmd/podman/parse" "github.com/containers/podman/v3/cmd/podman/parse"
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/cmd/podman/validate"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/machine" "github.com/containers/podman/v3/pkg/machine"
"github.com/containers/podman/v3/pkg/machine/qemu" "github.com/containers/podman/v3/pkg/machine/qemu"
"github.com/docker/go-units" "github.com/docker/go-units"
@ -25,15 +24,15 @@ import (
var ( var (
lsCmd = &cobra.Command{ lsCmd = &cobra.Command{
Use: "list [options]", Use: "list [options]",
Aliases: []string{"ls"}, Aliases: []string{"ls"},
Short: "List machines", Short: "List machines",
Long: "List managed virtual machines.", Long: "List managed virtual machines.",
RunE: list, RunE: list,
Args: validate.NoArgs, Args: validate.NoArgs,
ValidArgsFunction: completion.AutocompleteNone,
Example: `podman machine list, Example: `podman machine list,
podman machine ls`, podman machine ls`,
ValidArgsFunction: completion.AutocompleteNone,
} }
listFlag = listFlagType{} listFlag = listFlagType{}
) )
@ -52,7 +51,6 @@ type machineReporter struct {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: lsCmd, Command: lsCmd,
Parent: machineCmd, Parent: machineCmd,
}) })

View File

@ -7,7 +7,6 @@ import (
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/cmd/podman/validate"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/machine" "github.com/containers/podman/v3/pkg/machine"
"github.com/containers/podman/v3/pkg/machine/qemu" "github.com/containers/podman/v3/pkg/machine/qemu"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -30,7 +29,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: machineCmd, Command: machineCmd,
}) })
} }

View File

@ -2,4 +2,5 @@
package machine package machine
// init do not register _podman machine_ command on unsupported platforms
func init() {} func init() {}

View File

@ -9,7 +9,6 @@ import (
"strings" "strings"
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/machine" "github.com/containers/podman/v3/pkg/machine"
"github.com/containers/podman/v3/pkg/machine/qemu" "github.com/containers/podman/v3/pkg/machine/qemu"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -33,7 +32,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: rmCmd, Command: rmCmd,
Parent: machineCmd, Parent: machineCmd,
}) })

View File

@ -4,7 +4,6 @@ package machine
import ( import (
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/machine" "github.com/containers/podman/v3/pkg/machine"
"github.com/containers/podman/v3/pkg/machine/qemu" "github.com/containers/podman/v3/pkg/machine/qemu"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -30,7 +29,6 @@ var (
func init() { func init() {
sshCmd.Flags().SetInterspersed(false) sshCmd.Flags().SetInterspersed(false)
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: sshCmd, Command: sshCmd,
Parent: machineCmd, Parent: machineCmd,
}) })

View File

@ -4,7 +4,6 @@ package machine
import ( import (
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/machine" "github.com/containers/podman/v3/pkg/machine"
"github.com/containers/podman/v3/pkg/machine/qemu" "github.com/containers/podman/v3/pkg/machine/qemu"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -25,7 +24,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: startCmd, Command: startCmd,
Parent: machineCmd, Parent: machineCmd,
}) })

View File

@ -4,7 +4,6 @@ package machine
import ( import (
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/machine" "github.com/containers/podman/v3/pkg/machine"
"github.com/containers/podman/v3/pkg/machine/qemu" "github.com/containers/podman/v3/pkg/machine/qemu"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -24,7 +23,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: stopCmd, Command: stopCmd,
Parent: machineCmd, Parent: machineCmd,
}) })

View File

@ -3,6 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"os" "os"
"strings"
_ "github.com/containers/podman/v3/cmd/podman/completion" _ "github.com/containers/podman/v3/cmd/podman/completion"
_ "github.com/containers/podman/v3/cmd/podman/containers" _ "github.com/containers/podman/v3/cmd/podman/containers"
@ -42,38 +43,41 @@ func main() {
func parseCommands() *cobra.Command { func parseCommands() *cobra.Command {
cfg := registry.PodmanConfig() cfg := registry.PodmanConfig()
for _, c := range registry.Commands { for _, c := range registry.Commands {
for _, m := range c.Mode { if supported, found := c.Command.Annotations[registry.EngineMode]; found {
if cfg.EngineMode == m { if !strings.Contains(cfg.EngineMode.String(), supported) {
// Command cannot be run rootless continue
_, found := c.Command.Annotations[registry.UnshareNSRequired]
if found {
if rootless.IsRootless() && found && os.Getuid() != 0 {
c.Command.RunE = func(cmd *cobra.Command, args []string) error {
return fmt.Errorf("cannot run command %q in rootless mode, must execute `podman unshare` first", cmd.CommandPath())
}
}
} else {
_, found = c.Command.Annotations[registry.ParentNSRequired]
if rootless.IsRootless() && found {
c.Command.RunE = func(cmd *cobra.Command, args []string) error {
return fmt.Errorf("cannot run command %q in rootless mode", cmd.CommandPath())
}
}
}
parent := rootCmd
if c.Parent != nil {
parent = c.Parent
}
parent.AddCommand(c.Command)
// - templates need to be set here, as PersistentPreRunE() is
// not called when --help is used.
// - rootCmd uses cobra default template not ours
c.Command.SetHelpTemplate(helpTemplate)
c.Command.SetUsageTemplate(usageTemplate)
c.Command.DisableFlagsInUseLine = true
} }
} }
// Command cannot be run rootless
_, found := c.Command.Annotations[registry.UnshareNSRequired]
if found {
if rootless.IsRootless() && os.Getuid() != 0 {
c.Command.RunE = func(cmd *cobra.Command, args []string) error {
return fmt.Errorf("cannot run command %q in rootless mode, must execute `podman unshare` first", cmd.CommandPath())
}
}
} else {
_, found = c.Command.Annotations[registry.ParentNSRequired]
if rootless.IsRootless() && found {
c.Command.RunE = func(cmd *cobra.Command, args []string) error {
return fmt.Errorf("cannot run command %q in rootless mode", cmd.CommandPath())
}
}
}
parent := rootCmd
if c.Parent != nil {
parent = c.Parent
}
parent.AddCommand(c.Command)
// - templates need to be set here, as PersistentPreRunE() is
// not called when --help is used.
// - rootCmd uses cobra default template not ours
c.Command.SetHelpTemplate(helpTemplate)
c.Command.SetUsageTemplate(usageTemplate)
c.Command.DisableFlagsInUseLine = true
} }
if err := terminal.SetConsole(); err != nil { if err := terminal.SetConsole(); err != nil {
logrus.Error(err) logrus.Error(err)

View File

@ -39,7 +39,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: addCmd, Command: addCmd,
Parent: manifestCmd, Parent: manifestCmd,
}) })

View File

@ -15,6 +15,7 @@ import (
var ( var (
manifestAnnotateOpts = entities.ManifestAnnotateOptions{} manifestAnnotateOpts = entities.ManifestAnnotateOptions{}
annotateCmd = &cobra.Command{ annotateCmd = &cobra.Command{
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
Use: "annotate [options] LIST IMAGE", Use: "annotate [options] LIST IMAGE",
Short: "Add or update information about an entry in a manifest list or image index", Short: "Add or update information about an entry in a manifest list or image index",
Long: "Adds or updates information about an entry in a manifest list or image index.", Long: "Adds or updates information about an entry in a manifest list or image index.",
@ -27,7 +28,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Command: annotateCmd, Command: annotateCmd,
Parent: manifestCmd, Parent: manifestCmd,
}) })

View File

@ -27,7 +27,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: createCmd, Command: createCmd,
Parent: manifestCmd, Parent: manifestCmd,
}) })

View File

@ -3,7 +3,6 @@ package manifest
import ( import (
"github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -21,7 +20,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: existsCmd, Command: existsCmd,
Parent: manifestCmd, Parent: manifestCmd,
}) })

View File

@ -6,26 +6,23 @@ import (
"github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var ( var (
inspectCmd = &cobra.Command{ inspectCmd = &cobra.Command{
Use: "inspect IMAGE", Use: "inspect IMAGE",
Short: "Display the contents of a manifest list or image index", Short: "Display the contents of a manifest list or image index",
Long: "Display the contents of a manifest list or image index.", Long: "Display the contents of a manifest list or image index.",
RunE: inspect, RunE: inspect,
ValidArgsFunction: common.AutocompleteImages, ValidArgsFunction: common.AutocompleteImages,
Example: "podman manifest inspect localhost/list", Example: "podman manifest inspect localhost/list",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
DisableFlagsInUseLine: true,
} }
) )
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: inspectCmd, Command: inspectCmd,
Parent: manifestCmd, Parent: manifestCmd,
}) })

View File

@ -3,7 +3,6 @@ package manifest
import ( import (
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/cmd/podman/validate"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -26,7 +25,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: manifestCmd, Command: manifestCmd,
}) })
} }

View File

@ -39,7 +39,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: pushCmd, Command: pushCmd,
Parent: manifestCmd, Parent: manifestCmd,
}) })

View File

@ -6,27 +6,24 @@ import (
"github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var ( var (
removeCmd = &cobra.Command{ removeCmd = &cobra.Command{
Use: "remove LIST IMAGE", Use: "remove LIST IMAGE",
Short: "Remove an entry from a manifest list or image index", Short: "Remove an entry from a manifest list or image index",
Long: "Removes an image from a manifest list or image index.", Long: "Removes an image from a manifest list or image index.",
RunE: remove, RunE: remove,
ValidArgsFunction: common.AutocompleteImages, ValidArgsFunction: common.AutocompleteImages,
Example: `podman manifest remove mylist:v1.11 sha256:15352d97781ffdf357bf3459c037be3efac4133dc9070c2dce7eca7c05c3e736`, Example: `podman manifest remove mylist:v1.11 sha256:15352d97781ffdf357bf3459c037be3efac4133dc9070c2dce7eca7c05c3e736`,
Args: cobra.ExactArgs(2), Args: cobra.ExactArgs(2),
DisableFlagsInUseLine: true,
} }
) )
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: removeCmd, Command: removeCmd,
Parent: manifestCmd, Parent: manifestCmd,
}) })

View File

@ -6,27 +6,24 @@ import (
"github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/errorhandling" "github.com/containers/podman/v3/pkg/errorhandling"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var ( var (
rmCmd = &cobra.Command{ rmCmd = &cobra.Command{
Use: "rm LIST", Use: "rm LIST",
Short: "Remove manifest list or image index from local storage", Short: "Remove manifest list or image index from local storage",
Long: "Remove manifest list or image index from local storage.", Long: "Remove manifest list or image index from local storage.",
RunE: rm, RunE: rm,
ValidArgsFunction: common.AutocompleteImages, ValidArgsFunction: common.AutocompleteImages,
Example: `podman manifest rm mylist:v1.11`, Example: `podman manifest rm mylist:v1.11`,
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
DisableFlagsInUseLine: true,
} }
) )
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: rmCmd, Command: rmCmd,
Parent: manifestCmd, Parent: manifestCmd,
}) })

View File

@ -34,7 +34,6 @@ func networkConnectFlags(cmd *cobra.Command) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: networkConnectCommand, Command: networkConnectCommand,
Parent: networkCmd, Parent: networkCmd,
}) })

View File

@ -75,7 +75,6 @@ func networkCreateFlags(cmd *cobra.Command) {
} }
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: networkCreateCommand, Command: networkCreateCommand,
Parent: networkCmd, Parent: networkCmd,
}) })

View File

@ -31,7 +31,6 @@ func networkDisconnectFlags(flags *pflag.FlagSet) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: networkDisconnectCommand, Command: networkDisconnectCommand,
Parent: networkCmd, Parent: networkCmd,
}) })

View File

@ -3,7 +3,6 @@ package network
import ( import (
"github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -22,7 +21,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: networkExistsCommand, Command: networkExistsCommand,
Parent: networkCmd, Parent: networkCmd,
}) })

View File

@ -24,7 +24,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: networkinspectCommand, Command: networkinspectCommand,
Parent: networkCmd, Parent: networkCmd,
}) })

View File

@ -54,7 +54,6 @@ func networkListFlags(flags *pflag.FlagSet) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: networklistCommand, Command: networklistCommand,
Parent: networkCmd, Parent: networkCmd,
}) })

View File

@ -3,7 +3,6 @@ package network
import ( import (
"github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/cmd/podman/validate"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -22,7 +21,6 @@ var (
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: networkCmd, Command: networkCmd,
}) })
} }

View File

@ -43,7 +43,6 @@ func networkPruneFlags(cmd *cobra.Command, flags *pflag.FlagSet) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: networkPruneCommand, Command: networkPruneCommand,
Parent: networkCmd, Parent: networkCmd,
}) })

View File

@ -15,10 +15,11 @@ import (
var ( var (
networkReloadDescription = `reload container networks, recreating firewall rules` networkReloadDescription = `reload container networks, recreating firewall rules`
networkReloadCommand = &cobra.Command{ networkReloadCommand = &cobra.Command{
Use: "reload [options] [CONTAINER...]", Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
Short: "Reload firewall rules for one or more containers", Use: "reload [options] [CONTAINER...]",
Long: networkReloadDescription, Short: "Reload firewall rules for one or more containers",
RunE: networkReload, Long: networkReloadDescription,
RunE: networkReload,
Args: func(cmd *cobra.Command, args []string) error { Args: func(cmd *cobra.Command, args []string) error {
return validate.CheckAllLatestAndCIDFile(cmd, args, false, false) return validate.CheckAllLatestAndCIDFile(cmd, args, false, false)
}, },
@ -39,7 +40,6 @@ func reloadFlags(flags *pflag.FlagSet) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode},
Command: networkReloadCommand, Command: networkReloadCommand,
Parent: networkCmd, Parent: networkCmd,
}) })

View File

@ -38,7 +38,6 @@ func networkRmFlags(flags *pflag.FlagSet) {
func init() { func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{ registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: networkrmCommand, Command: networkrmCommand,
Parent: networkCmd, Parent: networkCmd,
}) })

Some files were not shown because too many files have changed in this diff Show More