libnetwork/iptables: make xLockWaitMsg a const

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-07-07 10:18:19 +02:00
parent 995da1e51d
commit 20900b76f9
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -66,7 +66,6 @@ var (
iptablesPath string
ip6tablesPath string
supportsXlock = false
xLockWaitMsg = "Another app is currently holding the xtables lock"
// used to lock iptables commands if xtables lock is not supported
bestEffortLock sync.Mutex
initOnce sync.Once
@ -474,9 +473,13 @@ func (iptable IPTable) exists(native bool, table Table, chain string, rule ...st
return err == nil
}
// Maximum duration that an iptables operation can take
// before flagging a warning.
const opWarnTime = 2 * time.Second
const (
// opWarnTime is the maximum duration that an iptables operation can take before flagging a warning.
opWarnTime = 2 * time.Second
// xLockWaitMsg is the iptables warning about xtables lock that can be suppressed.
xLockWaitMsg = "Another app is currently holding the xtables lock"
)
func filterOutput(start time.Time, output []byte, args ...string) []byte {
// Flag operations that have taken a long time to complete