mirror of https://github.com/k3s-io/k3s
Clean up host-gw variable names
parent
c23f12765e
commit
7675f9f85c
|
@ -44,14 +44,15 @@ const (
|
|||
"Backend": %backend%
|
||||
}
|
||||
`
|
||||
hostGwBackend = `{
|
||||
"Type": "host-gw"
|
||||
}`
|
||||
|
||||
vxlanBackend = `{
|
||||
"Type": "vxlan"
|
||||
}`
|
||||
|
||||
hostGWBackend = `{
|
||||
"Type": "host-gw"
|
||||
}`
|
||||
|
||||
ipsecBackend = `{
|
||||
"Type": "ipsec",
|
||||
"UDPEncap": true,
|
||||
|
@ -123,6 +124,8 @@ func createFlannelConf(nodeConfig *config.Node) error {
|
|||
switch nodeConfig.FlannelBackend {
|
||||
case config.FlannelBackendVXLAN:
|
||||
backendConf = vxlanBackend
|
||||
case config.FlannelBackendHostGW:
|
||||
backendConf = hostGWBackend
|
||||
case config.FlannelBackendIPSEC:
|
||||
backendConf = strings.Replace(ipsecBackend, "%psk%", nodeConfig.AgentConfig.IPSECPSK, -1)
|
||||
if err := setupStrongSwan(nodeConfig); err != nil {
|
||||
|
@ -130,8 +133,6 @@ func createFlannelConf(nodeConfig *config.Node) error {
|
|||
}
|
||||
case config.FlannelBackendWireguard:
|
||||
backendConf = wireguardBackend
|
||||
case config.FlannelBackendHOSTGW:
|
||||
backendConf = hostGwBackend
|
||||
default:
|
||||
return fmt.Errorf("Cannot configure unknown flannel backend '%s'", nodeConfig.FlannelBackend)
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
|
|||
},
|
||||
cli.StringFlag{
|
||||
Name: "flannel-backend",
|
||||
Usage: fmt.Sprintf("(networking) One of 'none', 'vxlan', 'ipsec', 'hostgw', or 'wireguard'"),
|
||||
Usage: fmt.Sprintf("(networking) One of 'none', 'vxlan', 'ipsec', 'host-gw', or 'wireguard'"),
|
||||
Destination: &ServerConfig.FlannelBackend,
|
||||
Value: "vxlan",
|
||||
},
|
||||
|
|
|
@ -16,9 +16,9 @@ import (
|
|||
const (
|
||||
FlannelBackendNone = "none"
|
||||
FlannelBackendVXLAN = "vxlan"
|
||||
FlannelBackendHostGW = "host-gw"
|
||||
FlannelBackendIPSEC = "ipsec"
|
||||
FlannelBackendWireguard = "wireguard"
|
||||
FlannelBackendHOSTGW = "hostgw"
|
||||
)
|
||||
|
||||
type Node struct {
|
||||
|
|
Loading…
Reference in New Issue