aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/networks/rm.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/networks/rm.go')
-rw-r--r--cmd/podman/networks/rm.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/podman/networks/rm.go b/cmd/podman/networks/rm.go
index c2d3f655f..d734b2867 100644
--- a/cmd/podman/networks/rm.go
+++ b/cmd/podman/networks/rm.go
@@ -63,6 +63,9 @@ func networkRm(cmd *cobra.Command, args []string) error {
}
responses, err := registry.ContainerEngine().NetworkRm(registry.Context(), args, networkRmOptions)
if err != nil {
+ if networkRmOptions.Force && strings.Contains(err.Error(), define.ErrNoSuchNetwork.Error()) {
+ return nil
+ }
setExitCode(err)
return err
}
@@ -70,6 +73,9 @@ func networkRm(cmd *cobra.Command, args []string) error {
if r.Err == nil {
fmt.Println(r.Name)
} else {
+ if networkRmOptions.Force && strings.Contains(r.Err.Error(), define.ErrNoSuchNetwork.Error()) {
+ continue
+ }
setExitCode(r.Err)
errs = append(errs, r.Err)
}