diff options
author | Jhon Honce <jhonce@redhat.com> | 2022-04-04 13:04:40 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2022-05-03 13:49:01 -0700 |
commit | 8da5f3f733273245dd4e86324ca88bf8e4ede37a (patch) | |
tree | 2c87e85d53cf01763fec61464e5a208b18de83ae /cmd/podman/machine/init.go | |
parent | 1e0c50df38ff955011f7ebb83a0268f3f1cd2841 (diff) | |
download | podman-8da5f3f733273245dd4e86324ca88bf8e4ede37a.tar.gz podman-8da5f3f733273245dd4e86324ca88bf8e4ede37a.tar.bz2 podman-8da5f3f733273245dd4e86324ca88bf8e4ede37a.zip |
Add podman machine events
Signed-off-by: Jhon Honce <jhonce@redhat.com>
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 := "" |