summaryrefslogtreecommitdiff
path: root/cmd/podman/machine/rm.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2022-04-04 13:04:40 -0700
committerJhon Honce <jhonce@redhat.com>2022-05-03 13:49:01 -0700
commit8da5f3f733273245dd4e86324ca88bf8e4ede37a (patch)
tree2c87e85d53cf01763fec61464e5a208b18de83ae /cmd/podman/machine/rm.go
parent1e0c50df38ff955011f7ebb83a0268f3f1cd2841 (diff)
downloadpodman-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/rm.go')
-rw-r--r--cmd/podman/machine/rm.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/cmd/podman/machine/rm.go b/cmd/podman/machine/rm.go
index 617a70a76..e678eb629 100644
--- a/cmd/podman/machine/rm.go
+++ b/cmd/podman/machine/rm.go
@@ -10,6 +10,7 @@ import (
"strings"
"github.com/containers/podman/v4/cmd/podman/registry"
+ "github.com/containers/podman/v4/libpod/events"
"github.com/containers/podman/v4/pkg/machine"
"github.com/spf13/cobra"
)
@@ -50,7 +51,7 @@ func init() {
flags.BoolVar(&destroyOptions.SaveImage, imageFlagName, false, "Do not delete the image file")
}
-func rm(cmd *cobra.Command, args []string) error {
+func rm(_ *cobra.Command, args []string) error {
var (
err error
vm machine.VM
@@ -83,5 +84,10 @@ func rm(cmd *cobra.Command, args []string) error {
return nil
}
}
- return remove()
+ err = remove()
+ if err != nil {
+ return err
+ }
+ newMachineEvent(events.Remove, events.Event{Name: vmName})
+ return nil
}