Commit 52323cba authored by Roberto Bonafiglia's avatar Roberto Bonafiglia Committed by Roberto Bonafiglia

Revert "Add ability to pass configuration options to flannel backend"

This reverts commit 86435769. Signed-off-by: 's avatarRoberto Bonafiglia <roberto.bonafiglia@suse.com>
parent b86a6947
...@@ -48,8 +48,7 @@ const ( ...@@ -48,8 +48,7 @@ const (
wireguardNativeBackend = `{ wireguardNativeBackend = `{
"Type": "wireguard", "Type": "wireguard",
"PersistentKeepaliveInterval": %PersistentKeepaliveInterval%, "PersistentKeepaliveInterval": 25
"Mode": "%Mode%"
}` }`
emptyIPv6Network = "::/0" emptyIPv6Network = "::/0"
...@@ -210,7 +209,6 @@ func createFlannelConf(nodeConfig *config.Node) error { ...@@ -210,7 +209,6 @@ func createFlannelConf(nodeConfig *config.Node) error {
} }
var backendConf string var backendConf string
backendOptions := make(map[string]string)
// precheck and error out unsupported flannel backends. // precheck and error out unsupported flannel backends.
switch nodeConfig.FlannelBackend { switch nodeConfig.FlannelBackend {
...@@ -241,16 +239,7 @@ func createFlannelConf(nodeConfig *config.Node) error { ...@@ -241,16 +239,7 @@ func createFlannelConf(nodeConfig *config.Node) error {
} }
backendConf = strings.ReplaceAll(tailscaledBackend, "%Routes%", routes) backendConf = strings.ReplaceAll(tailscaledBackend, "%Routes%", routes)
case config.FlannelBackendWireguardNative: case config.FlannelBackendWireguardNative:
mode, ok := backendOptions["Mode"] backendConf = wireguardNativeBackend
if !ok {
mode = "separate"
}
keepalive, ok := backendOptions["PersistentKeepaliveInterval"]
if !ok {
keepalive = "25"
}
backendConf = strings.ReplaceAll(wireguardNativeBackend, "%Mode%", mode)
backendConf = strings.ReplaceAll(backendConf, "%PersistentKeepaliveInterval%", keepalive)
default: default:
return fmt.Errorf("Cannot configure unknown flannel backend '%s'", nodeConfig.FlannelBackend) return fmt.Errorf("Cannot configure unknown flannel backend '%s'", nodeConfig.FlannelBackend)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment