diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-05-03 19:16:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-03 19:16:03 -0400 |
commit | 3d84661195aa8fbf3dab67375099cb991fd7fe81 (patch) | |
tree | 2c87e85d53cf01763fec61464e5a208b18de83ae /cmd/podman/machine/rm.go | |
parent | 1e0c50df38ff955011f7ebb83a0268f3f1cd2841 (diff) | |
parent | 8da5f3f733273245dd4e86324ca88bf8e4ede37a (diff) | |
download | podman-3d84661195aa8fbf3dab67375099cb991fd7fe81.tar.gz podman-3d84661195aa8fbf3dab67375099cb991fd7fe81.tar.bz2 podman-3d84661195aa8fbf3dab67375099cb991fd7fe81.zip |
Merge pull request #14085 from jwhonce/jira/RUN-1491
Add podman machine events
Diffstat (limited to 'cmd/podman/machine/rm.go')
-rw-r--r-- | cmd/podman/machine/rm.go | 10 |
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 } |