Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Clean up the Monitor go routine
Browse files Browse the repository at this point in the history
  • Loading branch information
foot committed Jul 3, 2020
1 parent 62fb826 commit 01230ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions prog/weaver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/weaveworks/common/mflagext"
"github.com/weaveworks/common/signals"
"github.com/weaveworks/mesh"
"k8s.io/apimachinery/pkg/util/wait"

"github.com/weaveworks/weave/common"
"github.com/weaveworks/weave/common/docker"
Expand Down Expand Up @@ -529,7 +528,9 @@ func main() {

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 {
Log.Printf("Not refreshing iptables (interval: %v)", iptablesRefresh)
}
Expand Down

0 comments on commit 01230ed

Please sign in to comment.