diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-06-20 15:05:25 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-06-20 15:36:00 +0200 |
commit | 46da7bc78f95a267e1c3faadea1725ec6b3dfb46 (patch) | |
tree | efcc1b735db455f9bda267ef9032071e4c53c0f2 | |
parent | 55052c6b9807b5a51b50abc90e391e872be450c2 (diff) | |
download | podman-46da7bc78f95a267e1c3faadea1725ec6b3dfb46.tar.gz podman-46da7bc78f95a267e1c3faadea1725ec6b3dfb46.tar.bz2 podman-46da7bc78f95a267e1c3faadea1725ec6b3dfb46.zip |
podman machine init --now: respect proxy envs
podman machine start contains more logic than just the simple vm.Start()
call. Instead of duplicating this into inti we just call start().
[NO NEW TESTS NEEDED] I have no way to test this right now.
Fixes #14640
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
-rw-r--r-- | cmd/podman/machine/init.go | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/cmd/podman/machine/init.go b/cmd/podman/machine/init.go index 612c36057..9d464ad37 100644 --- a/cmd/podman/machine/init.go +++ b/cmd/podman/machine/init.go @@ -109,7 +109,7 @@ func init() { flags.BoolVar(&initOpts.Rootful, rootfulFlagName, false, "Whether this machine should prefer rootful container execution") } -func initMachine(_ *cobra.Command, args []string) error { +func initMachine(cmd *cobra.Command, args []string) error { var ( err error vm machine.VM @@ -147,17 +147,12 @@ func initMachine(_ *cobra.Command, args []string) error { fmt.Println("Machine init complete") if now { - err = vm.Start(initOpts.Name, machine.StartOptions{}) - if err == nil { - fmt.Printf("Machine %q started successfully\n", initOpts.Name) - newMachineEvent(events.Start, events.Event{Name: initOpts.Name}) - } - } else { - extra := "" - if initOpts.Name != defaultMachineName { - extra = " " + initOpts.Name - } - fmt.Printf("To start your machine run:\n\n\tpodman machine start%s\n\n", extra) + return start(cmd, args) + } + extra := "" + if initOpts.Name != defaultMachineName { + extra = " " + initOpts.Name } + fmt.Printf("To start your machine run:\n\n\tpodman machine start%s\n\n", extra) return err } |