mirror of https://github.com/containers/podman.git
Merge pull request #14665 from Luap99/machine-now
podman machine init --now: respect proxy envs
This commit is contained in:
commit
157a966ae8
|
@ -109,7 +109,7 @@ func init() {
|
||||||
flags.BoolVar(&initOpts.Rootful, rootfulFlagName, false, "Whether this machine should prefer rootful container execution")
|
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 (
|
var (
|
||||||
err error
|
err error
|
||||||
vm machine.VM
|
vm machine.VM
|
||||||
|
@ -147,17 +147,12 @@ func initMachine(_ *cobra.Command, args []string) error {
|
||||||
fmt.Println("Machine init complete")
|
fmt.Println("Machine init complete")
|
||||||
|
|
||||||
if now {
|
if now {
|
||||||
err = vm.Start(initOpts.Name, machine.StartOptions{})
|
return start(cmd, args)
|
||||||
if err == nil {
|
|
||||||
fmt.Printf("Machine %q started successfully\n", initOpts.Name)
|
|
||||||
newMachineEvent(events.Start, events.Event{Name: initOpts.Name})
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
extra := ""
|
extra := ""
|
||||||
if initOpts.Name != defaultMachineName {
|
if initOpts.Name != defaultMachineName {
|
||||||
extra = " " + initOpts.Name
|
extra = " " + initOpts.Name
|
||||||
}
|
}
|
||||||
fmt.Printf("To start your machine run:\n\n\tpodman machine start%s\n\n", extra)
|
fmt.Printf("To start your machine run:\n\n\tpodman machine start%s\n\n", extra)
|
||||||
}
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue