Skip to content

Commit

Permalink
Merge pull request #14665 from Luap99/machine-now
Browse files Browse the repository at this point in the history
podman machine init --now: respect proxy envs
  • Loading branch information
openshift-ci[bot] authored Jun 27, 2022
2 parents c8cb7a2 + 46da7bc commit 157a966
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions cmd/podman/machine/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

0 comments on commit 157a966

Please sign in to comment.