aboutsummaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2021-05-16 17:42:23 +0200
committerPaul Holzinger <paul.holzinger@web.de>2021-05-17 10:55:02 +0200
commit4462113c5e1d51b2ac6516afb96a9ae83c00254e (patch)
tree10727f7d0d237fa4303bc5f0d411a45e5565e882 /pkg/domain
parenta6a3df0273d19197286d12a805d7bc34c787b25f (diff)
downloadpodman-4462113c5e1d51b2ac6516afb96a9ae83c00254e.tar.gz
podman-4462113c5e1d51b2ac6516afb96a9ae83c00254e.tar.bz2
podman-4462113c5e1d51b2ac6516afb96a9ae83c00254e.zip
podman network reload add rootless support
Allow podman network reload to be run as rootless user. While it is unlikely that the iptable rules are flushed inside the rootless cni namespace, it could still happen. Also fix podman network reload --all to ignore errors when a container does not have the bridge network mode, e.g. slirp4netns. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/infra/abi/network.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/network.go b/pkg/domain/infra/abi/network.go
index 1a833332c..33ab280e5 100644
--- a/pkg/domain/infra/abi/network.go
+++ b/pkg/domain/infra/abi/network.go
@@ -71,7 +71,9 @@ func (ic *ContainerEngine) NetworkReload(ctx context.Context, names []string, op
report := new(entities.NetworkReloadReport)
report.Id = ctr.ID()
report.Err = ctr.ReloadNetwork()
- if options.All && errors.Cause(report.Err) == define.ErrCtrStateInvalid {
+ // ignore errors for invalid ctr state and network mode when --all is used
+ if options.All && (errors.Cause(report.Err) == define.ErrCtrStateInvalid ||
+ errors.Cause(report.Err) == define.ErrNetworkModeInvalid) {
continue
}
reports = append(reports, report)