Rename Monitor -> MonitorForIptablesFlush
- Makes it all a bit more explicit
This commit is contained in:
1 parent
1d7ca17c3e
commit
341bac9968
2 files changed
+3
-3
No files matched your search
+2
-2
@@ -130,10 +130,10 @@ const (
|
|||||||
iptablesFlushPollTime = 100 * time.Millisecond
|
iptablesFlushPollTime = 100 * time.Millisecond
|
||||||
)
|
)
|
||||||
|
|
||||||
// Monitor periodically checks for a canary chain in iptables. If this canary chain goes missing it calls the reloadFunc.
|
// MonitorForIptablesFlush periodically checks for a canary chain in iptables. If this canary chain goes missing it calls the reloadFunc.
|
||||||
// This is a more efficient way of detecting whether firewalld or another process has been removing rules that we rely on.
|
// This is a more efficient way of detecting whether firewalld or another process has been removing rules that we rely on.
|
||||||
// The reloadFunc can then check whether other chains that should exist are still there, fix things and restore the canary.
|
// The reloadFunc can then check whether other chains that should exist are still there, fix things and restore the canary.
|
||||||
func Monitor(log *logrus.Logger, canary string, tables []string, reloadFunc func(), interval time.Duration, stopCh <-chan struct{}) {
|
func MonitorForIptablesFlush(log *logrus.Logger, canary string, tables []string, reloadFunc func(), interval time.Duration, stopCh <-chan struct{}) {
|
||||||
ipt, err := iptables.New()
|
ipt, err := iptables.New()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("creating iptables object while initializing iptable Monitoring %s", err)
|
log.Errorf("creating iptables object while initializing iptable Monitoring %s", err)
|
||||||
|
|||||||
+1
-1
@@ -524,7 +524,7 @@ func main() {
|
|||||||
weavenet.Reexpose(&bridgeConfig, Log)
|
weavenet.Reexpose(&bridgeConfig, Log)
|
||||||
}
|
}
|
||||||
stopChan := make(chan struct{})
|
stopChan := make(chan struct{})
|
||||||
go weavenet.Monitor(Log, "WEAVE-CANARY", []string{"mangle", "nat", "filter"}, applyIPTables, 10*time.Second, stopChan)
|
go weavenet.MonitorForIptablesFlush(Log, "WEAVE-CANARY", []string{"mangle", "nat", "filter"}, applyIPTables, 10*time.Second, stopChan)
|
||||||
defer close(stopChan)
|
defer close(stopChan)
|
||||||
|
|
||||||
signals.SignalHandlerLoop(common.Log, router)
|
signals.SignalHandlerLoop(common.Log, router)
|
||||||
|
|||||||
Reference in new issue
Block a user