|
|
@ -118,7 +118,7 @@ func createFlannelConf(nodeConfig *config.Node) error {
|
|
|
|
logrus.Infof("Using custom flannel conf defined at %s", nodeConfig.FlannelConf)
|
|
|
|
logrus.Infof("Using custom flannel conf defined at %s", nodeConfig.FlannelConf)
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
confJSON := strings.Replace(flannelConf, "%CIDR%", nodeConfig.AgentConfig.ClusterCIDR.String(), -1)
|
|
|
|
confJSON := strings.ReplaceAll(flannelConf, "%CIDR%", nodeConfig.AgentConfig.ClusterCIDR.String())
|
|
|
|
|
|
|
|
|
|
|
|
var backendConf string
|
|
|
|
var backendConf string
|
|
|
|
|
|
|
|
|
|
|
@ -128,7 +128,7 @@ func createFlannelConf(nodeConfig *config.Node) error {
|
|
|
|
case config.FlannelBackendHostGW:
|
|
|
|
case config.FlannelBackendHostGW:
|
|
|
|
backendConf = hostGWBackend
|
|
|
|
backendConf = hostGWBackend
|
|
|
|
case config.FlannelBackendIPSEC:
|
|
|
|
case config.FlannelBackendIPSEC:
|
|
|
|
backendConf = strings.Replace(ipsecBackend, "%psk%", nodeConfig.AgentConfig.IPSECPSK, -1)
|
|
|
|
backendConf = strings.ReplaceAll(ipsecBackend, "%psk%", nodeConfig.AgentConfig.IPSECPSK)
|
|
|
|
if err := setupStrongSwan(nodeConfig); err != nil {
|
|
|
|
if err := setupStrongSwan(nodeConfig); err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -137,7 +137,7 @@ func createFlannelConf(nodeConfig *config.Node) error {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return fmt.Errorf("Cannot configure unknown flannel backend '%s'", nodeConfig.FlannelBackend)
|
|
|
|
return fmt.Errorf("Cannot configure unknown flannel backend '%s'", nodeConfig.FlannelBackend)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
confJSON = strings.Replace(confJSON, "%backend%", backendConf, -1)
|
|
|
|
confJSON = strings.ReplaceAll(confJSON, "%backend%", backendConf)
|
|
|
|
|
|
|
|
|
|
|
|
return util.WriteFile(nodeConfig.FlannelConf, confJSON)
|
|
|
|
return util.WriteFile(nodeConfig.FlannelConf, confJSON)
|
|
|
|
}
|
|
|
|
}
|
|
|
|