diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-05-04 11:28:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-04 11:28:11 -0400 |
commit | 02eef6c4bf5b423c5f97a9883d21f2b4152a45ce (patch) | |
tree | f270d90ebba169bb883398a8a42c10f1df8ea305 /cmd/podman/machine/init.go | |
parent | 89e60648404bfbcf9ea8d5cb84c01c1f5e72a890 (diff) | |
parent | a21e112364f93a1a7d342584a239b289a8ee9f0a (diff) | |
download | podman-02eef6c4bf5b423c5f97a9883d21f2b4152a45ce.tar.gz podman-02eef6c4bf5b423c5f97a9883d21f2b4152a45ce.tar.bz2 podman-02eef6c4bf5b423c5f97a9883d21f2b4152a45ce.zip |
Merge pull request #14112 from openshift-cherrypick-robot/cherry-pick-14085-to-v4.1
[v4.1] Add podman machine events
Diffstat (limited to 'cmd/podman/machine/init.go')
-rw-r--r-- | cmd/podman/machine/init.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/podman/machine/init.go b/cmd/podman/machine/init.go index 4991c6aa3..733266b85 100644 --- a/cmd/podman/machine/init.go +++ b/cmd/podman/machine/init.go @@ -9,6 +9,7 @@ import ( "github.com/containers/common/pkg/completion" "github.com/containers/podman/v4/cmd/podman/registry" + "github.com/containers/podman/v4/libpod/events" "github.com/containers/podman/v4/pkg/machine" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -145,11 +146,14 @@ func initMachine(cmd *cobra.Command, args []string) error { // Finished = *, err != nil - Exit with an error message return err } + newMachineEvent(events.Init, events.Event{Name: initOpts.Name}) 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 := "" |