diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-03-19 11:28:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-19 11:28:38 +0100 |
commit | 19c80199a9973be16cc7c8a5c664a18b179f0179 (patch) | |
tree | 35c33b726c63b4f204f345f6c6a3d810876d914e /cmd | |
parent | e3184e963c09f1b989f729297a1cb62ed39d2881 (diff) | |
parent | 6878376c42125a783333d4c587c7183f27efed19 (diff) | |
download | podman-19c80199a9973be16cc7c8a5c664a18b179f0179.tar.gz podman-19c80199a9973be16cc7c8a5c664a18b179f0179.tar.bz2 podman-19c80199a9973be16cc7c8a5c664a18b179f0179.zip |
Merge pull request #13560 from n1hility/backport-handle-incompatible
[v4.0] Backport handling of incompatible machines
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/machine/rm.go | 14 | ||||
-rw-r--r-- | cmd/podman/machine/start.go | 4 |
2 files changed, 7 insertions, 11 deletions
diff --git a/cmd/podman/machine/rm.go b/cmd/podman/machine/rm.go index 38873084a..68e55b071 100644 --- a/cmd/podman/machine/rm.go +++ b/cmd/podman/machine/rm.go @@ -26,7 +26,7 @@ var ( ) var ( - destoryOptions machine.RemoveOptions + destroyOptions machine.RemoveOptions ) func init() { @@ -37,16 +37,16 @@ func init() { flags := rmCmd.Flags() formatFlagName := "force" - flags.BoolVar(&destoryOptions.Force, formatFlagName, false, "Do not prompt before rming") + flags.BoolVarP(&destroyOptions.Force, formatFlagName, "f", false, "Stop and do not prompt before rming") keysFlagName := "save-keys" - flags.BoolVar(&destoryOptions.SaveKeys, keysFlagName, false, "Do not delete SSH keys") + flags.BoolVar(&destroyOptions.SaveKeys, keysFlagName, false, "Do not delete SSH keys") ignitionFlagName := "save-ignition" - flags.BoolVar(&destoryOptions.SaveIgnition, ignitionFlagName, false, "Do not delete ignition file") + flags.BoolVar(&destroyOptions.SaveIgnition, ignitionFlagName, false, "Do not delete ignition file") imageFlagName := "save-image" - flags.BoolVar(&destoryOptions.SaveImage, imageFlagName, false, "Do not delete the image file") + flags.BoolVar(&destroyOptions.SaveImage, imageFlagName, false, "Do not delete the image file") } func rm(cmd *cobra.Command, args []string) error { @@ -64,12 +64,12 @@ func rm(cmd *cobra.Command, args []string) error { if err != nil { return err } - confirmationMessage, remove, err := vm.Remove(vmName, machine.RemoveOptions{}) + confirmationMessage, remove, err := vm.Remove(vmName, destroyOptions) if err != nil { return err } - if !destoryOptions.Force { + if !destroyOptions.Force { // Warn user fmt.Println(confirmationMessage) reader := bufio.NewReader(os.Stdin) diff --git a/cmd/podman/machine/start.go b/cmd/podman/machine/start.go index 16faa25ef..56acb09cb 100644 --- a/cmd/podman/machine/start.go +++ b/cmd/podman/machine/start.go @@ -57,10 +57,6 @@ func start(cmd *cobra.Command, args []string) error { } return errors.Wrapf(machine.ErrMultipleActiveVM, "cannot start VM %s. VM %s is currently running", vmName, activeName) } - vm, err = provider.LoadVMByName(vmName) - if err != nil { - return err - } fmt.Printf("Starting machine %q\n", vmName) if err := vm.Start(vmName, machine.StartOptions{}); err != nil { return err |