diff options
Diffstat (limited to 'cmd/podman/volumes/rm.go')
-rw-r--r-- | cmd/podman/volumes/rm.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/podman/volumes/rm.go b/cmd/podman/volumes/rm.go index c160b8623..1383da279 100644 --- a/cmd/podman/volumes/rm.go +++ b/cmd/podman/volumes/rm.go @@ -65,6 +65,9 @@ func rm(cmd *cobra.Command, args []string) error { } responses, err := registry.ContainerEngine().VolumeRm(context.Background(), args, rmOptions) if err != nil { + if rmOptions.Force && strings.Contains(err.Error(), define.ErrNoSuchVolume.Error()) { + return nil + } setExitCode(err) return err } @@ -72,6 +75,9 @@ func rm(cmd *cobra.Command, args []string) error { if r.Err == nil { fmt.Println(r.Id) } else { + if rmOptions.Force && strings.Contains(r.Err.Error(), define.ErrNoSuchVolume.Error()) { + continue + } setExitCode(r.Err) errs = append(errs, r.Err) } |