summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2020-09-28 13:34:56 +0200
committerPaul Holzinger <paul.holzinger@web.de>2020-09-28 13:34:56 +0200
commit343a10e25fb12685f18ed3600c567397c01a7cc8 (patch)
tree755a73bf2863a88b5523692f1c920177930620a9 /pkg/domain
parent393120c13567ef1b6d42bac357eddf44cfa74d16 (diff)
downloadpodman-343a10e25fb12685f18ed3600c567397c01a7cc8.tar.gz
podman-343a10e25fb12685f18ed3600c567397c01a7cc8.tar.bz2
podman-343a10e25fb12685f18ed3600c567397c01a7cc8.zip
Fix network remove for the podman remote client
The podman remote client ignored the force option due a typo. If an error occured the remote client would panic with an index out of range error. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/infra/tunnel/network.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkg/domain/infra/tunnel/network.go b/pkg/domain/infra/tunnel/network.go
index 074425087..d155fdd9e 100644
--- a/pkg/domain/infra/tunnel/network.go
+++ b/pkg/domain/infra/tunnel/network.go
@@ -26,11 +26,16 @@ func (ic *ContainerEngine) NetworkInspect(ctx context.Context, namesOrIds []stri
func (ic *ContainerEngine) NetworkRm(ctx context.Context, namesOrIds []string, options entities.NetworkRmOptions) ([]*entities.NetworkRmReport, error) {
reports := make([]*entities.NetworkRmReport, 0, len(namesOrIds))
for _, name := range namesOrIds {
- report, err := network.Remove(ic.ClientCxt, name, &options.Force)
+ response, err := network.Remove(ic.ClientCxt, name, &options.Force)
if err != nil {
- report[0].Err = err
+ report := &entities.NetworkRmReport{
+ Name: name,
+ Err: err,
+ }
+ reports = append(reports, report)
+ } else {
+ reports = append(reports, response...)
}
- reports = append(reports, report...)
}
return reports, nil
}