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
committeropenshift-cherrypick-robot <>2022-05-04 13:42:38 +0000
commita21e112364f93a1a7d342584a239b289a8ee9f0a (patch)
treeb6c3632932fc703a82a55fc50727f24f0fc323d2 /cmd/podman/machine/rm.go
parent3210a3f4257d19744abd4ae2302018b16edb2507 (diff)
downloadpodman-a21e112364f93a1a7d342584a239b289a8ee9f0a.tar.gz
podman-a21e112364f93a1a7d342584a239b289a8ee9f0a.tar.bz2
podman-a21e112364f93a1a7d342584a239b289a8ee9f0a.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
}