Clean up the Monitor go routine

This commit is contained in:
Simon Howe committed 2020-07-15 11:37:53 +02:00
1 parent ca7103d007
commit 709b434f55
1 file changed
+3 -2
+3 -2
View File
@@ -17,7 +17,6 @@ import (
"github.com/weaveworks/common/mflagext" "github.com/weaveworks/common/mflagext"
"github.com/weaveworks/common/signals" "github.com/weaveworks/common/signals"
"github.com/weaveworks/mesh" "github.com/weaveworks/mesh"
"k8s.io/apimachinery/pkg/util/wait"
"github.com/weaveworks/weave/common" "github.com/weaveworks/weave/common"
"github.com/weaveworks/weave/common/docker" "github.com/weaveworks/weave/common/docker"
@@ -529,7 +528,9 @@ func main() {
weavenet.Reexpose(&bridgeConfig, Log) weavenet.Reexpose(&bridgeConfig, Log)
} }
go weavenet.Monitor(Log, "WEAVE-CANARY", []string{"mangle", "nat", "filter"}, applyIPTables, iptablesRefresh, wait.NeverStop) stopChan := make(chan struct{})
go weavenet.Monitor(Log, "WEAVE-CANARY", []string{"mangle", "nat", "filter"}, applyIPTables, iptablesRefresh, stopChan)
defer close(stopChan)
} else { } else {
Log.Printf("Not refreshing iptables (interval: %v)", iptablesRefresh) Log.Printf("Not refreshing iptables (interval: %v)", iptablesRefresh)
} }