support hostgw

This commit is contained in:
Segator 2019-11-26 20:27:06 +01:00 committed by Erik Wilson
parent d14faf95ba
commit 6736e24673
2 changed files with 7 additions and 1 deletions

View File

@ -44,6 +44,9 @@ const (
"Backend": %backend% "Backend": %backend%
} }
` `
hostGwBackend = `{
"Type": "host-gw"
}`
vxlanBackend = `{ vxlanBackend = `{
"Type": "vxlan" "Type": "vxlan"
@ -127,6 +130,8 @@ func createFlannelConf(nodeConfig *config.Node) error {
} }
case config.FlannelBackendWireguard: case config.FlannelBackendWireguard:
backendConf = wireguardBackend backendConf = wireguardBackend
case config.FlannelBackendHOSTGW:
backendConf = hostGwBackend
default: default:
return fmt.Errorf("Cannot configure unknown flannel backend '%s'", nodeConfig.FlannelBackend) return fmt.Errorf("Cannot configure unknown flannel backend '%s'", nodeConfig.FlannelBackend)
} }
@ -161,4 +166,4 @@ func setupStrongSwan(nodeConfig *config.Node) error {
// make new strongswan link // make new strongswan link
return os.Symlink(dataDir, nodeConfig.AgentConfig.StrongSwanDir) return os.Symlink(dataDir, nodeConfig.AgentConfig.StrongSwanDir)
} }

View File

@ -18,6 +18,7 @@ const (
FlannelBackendVXLAN = "vxlan" FlannelBackendVXLAN = "vxlan"
FlannelBackendIPSEC = "ipsec" FlannelBackendIPSEC = "ipsec"
FlannelBackendWireguard = "wireguard" FlannelBackendWireguard = "wireguard"
FlannelBackendHOSTGW = "hostgw"
) )
type Node struct { type Node struct {