libnetwork: skip firewalld management for rootless

Fix issue 43781

Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit 9464898b47)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Akihiro Suda 2022-07-11 09:48:18 +09:00 committed by Sebastiaan van Stijn
parent 6408132d74
commit 863ca3f185
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 7 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import (
"sync"
"time"
"github.com/docker/docker/rootless"
"github.com/sirupsen/logrus"
)
@ -105,6 +106,12 @@ func probe() {
}
func initFirewalld() {
// When running with RootlessKit, firewalld is running as the root outside our network namespace
// https://github.com/moby/moby/issues/43781
if rootless.RunningWithRootlessKit() {
logrus.Info("skipping firewalld management for rootless mode")
return
}
if err := FirewalldInit(); err != nil {
logrus.Debugf("Fail to initialize firewalld: %v, using raw iptables instead", err)
}