Removes disabling iptable canary

- Should always be on. Simpler.
This commit is contained in:
Simon Howe committed 2020-07-15 11:37:53 +02:00
1 parent 709b434f55
commit 899490c3f9
1 file changed
+1 -9
+1 -9
View File
@@ -168,7 +168,6 @@ func main() {
procPath string procPath string
discoveryEndpoint string discoveryEndpoint string
token string token string
iptablesRefresh time.Duration
advertiseAddress string advertiseAddress string
pluginConfig plugin.Config pluginConfig plugin.Config
defaultDockerHost = getenvOrDefault("DOCKER_HOST", "unix:///var/run/docker.sock") defaultDockerHost = getenvOrDefault("DOCKER_HOST", "unix:///var/run/docker.sock")
@@ -217,7 +216,6 @@ func main() {
mflag.StringVar(&discoveryEndpoint, []string{"-peer-discovery-url"}, "https://cloud.weave.works/api/net", "url for peer discovery") mflag.StringVar(&discoveryEndpoint, []string{"-peer-discovery-url"}, "https://cloud.weave.works/api/net", "url for peer discovery")
mflag.StringVar(&token, []string{"-token"}, "", "token for peer discovery") mflag.StringVar(&token, []string{"-token"}, "", "token for peer discovery")
mflag.StringVar(&advertiseAddress, []string{"-advertise-address"}, "", "address to advertise for peer discovery") mflag.StringVar(&advertiseAddress, []string{"-advertise-address"}, "", "address to advertise for peer discovery")
mflag.DurationVar(&iptablesRefresh, []string{"-iptables-refresh-interval"}, 10*time.Second, "Interval to reapply iptables. 0 to only apply on launch.")
mflag.BoolVar(&pluginConfig.Enable, []string{"-plugin"}, false, "enable Docker plugin (v1)") mflag.BoolVar(&pluginConfig.Enable, []string{"-plugin"}, false, "enable Docker plugin (v1)")
mflag.BoolVar(&pluginConfig.EnableV2, []string{"-plugin-v2"}, false, "enable Docker plugin (v2)") mflag.BoolVar(&pluginConfig.EnableV2, []string{"-plugin-v2"}, false, "enable Docker plugin (v2)")
@@ -517,23 +515,17 @@ func main() {
go exposeForAWSVPC(allocator, defaultSubnet, bridgeConfig.WeaveBridgeName, waitReady.Add()) go exposeForAWSVPC(allocator, defaultSubnet, bridgeConfig.WeaveBridgeName, waitReady.Add())
} }
if iptablesRefresh > 0 {
Log.Printf("Entering iptable refresh loop (interval %v)", iptablesRefresh)
applyIPTables := func() { applyIPTables := func() {
Log.Info("Re-configuring iptables") Log.Info("Re-configuring iptables")
err := weavenet.ConfigureIPTables(&bridgeConfig, ips) err := weavenet.ConfigureIPTables(&bridgeConfig, ips)
if err != nil { if err != nil {
Log.Errorf("Error configuring iptables: %s", err) Log.Errorf("Error configuring iptables: %s", err)
} }
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, iptablesRefresh, stopChan) go weavenet.Monitor(Log, "WEAVE-CANARY", []string{"mangle", "nat", "filter"}, applyIPTables, 10*time.Second, stopChan)
defer close(stopChan) defer close(stopChan)
} else {
Log.Printf("Not refreshing iptables (interval: %v)", iptablesRefresh)
}
signals.SignalHandlerLoop(common.Log, router) signals.SignalHandlerLoop(common.Log, router)
} }