aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-06-27 12:27:28 +0000
committerGitHub <noreply@github.com>2022-06-27 12:27:28 +0000
commit157a966ae802af221aed278054cffcb68790c036 (patch)
treeb8c047f539ff9473ed9a8321844636f1483b3b5d /cmd
parentc8cb7a2b9964351c3d82228cda50942beb67f095 (diff)
parent46da7bc78f95a267e1c3faadea1725ec6b3dfb46 (diff)
downloadpodman-157a966ae802af221aed278054cffcb68790c036.tar.gz
podman-157a966ae802af221aed278054cffcb68790c036.tar.bz2
podman-157a966ae802af221aed278054cffcb68790c036.zip
Merge pull request #14665 from Luap99/machine-now
podman machine init --now: respect proxy envs
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/machine/init.go19
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
}