Removed old conf var
This commit is contained in:
@@ -21,8 +21,8 @@ func DefaultMonoKSConfig(v TemplateValues) types.MonoKSConfig {
|
||||
KubernetesVersion: v.KubernetesVersion,
|
||||
NodeName: firstNonEmpty(v.NodeName, v.Hostname),
|
||||
|
||||
ClusterRole: clusterRoleFromTemplateValues(v),
|
||||
InitControlPlane: initControlPlaneFromTemplateValues(v),
|
||||
ClusterRole: v.ClusterRole,
|
||||
InitControlPlane: v.InitControlPlane,
|
||||
|
||||
ClusterName: v.ClusterName,
|
||||
ClusterDomain: v.ClusterDomain,
|
||||
@@ -84,24 +84,6 @@ func DefaultOSUpgrade(v TemplateValues) types.OSUpgrade {
|
||||
}
|
||||
}
|
||||
|
||||
func clusterRoleFromTemplateValues(v TemplateValues) string {
|
||||
switch strings.ToLower(strings.TrimSpace(v.BootstrapMode)) {
|
||||
case "init":
|
||||
return "control-plane"
|
||||
case "join":
|
||||
if strings.EqualFold(strings.TrimSpace(v.JoinKind), "control-plane") {
|
||||
return "control-plane"
|
||||
}
|
||||
return "worker"
|
||||
default:
|
||||
return "control-plane"
|
||||
}
|
||||
}
|
||||
|
||||
func initControlPlaneFromTemplateValues(v TemplateValues) bool {
|
||||
return strings.EqualFold(strings.TrimSpace(v.BootstrapMode), "init")
|
||||
}
|
||||
|
||||
func firstNonEmpty(xs ...string) string {
|
||||
for _, x := range xs {
|
||||
if strings.TrimSpace(x) != "" {
|
||||
|
||||
@@ -23,8 +23,8 @@ type TemplateValues struct {
|
||||
ContainerRuntimeEndpoint string
|
||||
CNIPlugin string
|
||||
|
||||
BootstrapMode string // init, join
|
||||
JoinKind string // worker, control-plane
|
||||
ClusterRole string // worker, control-plane
|
||||
InitControlPlane bool
|
||||
|
||||
AllowSchedulingOnControlPlane bool
|
||||
SkipImageCheck bool
|
||||
@@ -57,8 +57,8 @@ func defaultTemplateValues() TemplateValues {
|
||||
ContainerRuntimeEndpoint: "unix:///var/run/crio/crio.sock",
|
||||
CNIPlugin: "default",
|
||||
|
||||
BootstrapMode: "init",
|
||||
JoinKind: "worker",
|
||||
InitControlPlane: true,
|
||||
ClusterRole: "control-plane",
|
||||
|
||||
AllowSchedulingOnControlPlane: true,
|
||||
SkipImageCheck: false,
|
||||
@@ -103,8 +103,8 @@ func LoadTemplateValuesFromEnv() TemplateValues {
|
||||
v.ContainerRuntimeEndpoint = getenvDefault("MKS_CONTAINER_RUNTIME_ENDPOINT", v.ContainerRuntimeEndpoint)
|
||||
v.CNIPlugin = getenvDefault("MKS_CNI_PLUGIN", v.CNIPlugin)
|
||||
|
||||
v.BootstrapMode = getenvDefault("MKS_BOOTSTRAP_MODE", v.BootstrapMode)
|
||||
v.JoinKind = getenvDefault("MKS_JOIN_KIND", v.JoinKind)
|
||||
v.InitControlPlane = getenvBoolDefault("MKS_INIT_CONTROL_PLANE", v.InitControlPlane)
|
||||
v.ClusterRole = getenvDefault("MKS_CLUSTER_ROLE", v.ClusterRole)
|
||||
|
||||
v.AllowSchedulingOnControlPlane = getenvBoolDefault("MKS_ALLOW_SCHEDULING_ON_CONTROL_PLANE", v.AllowSchedulingOnControlPlane)
|
||||
v.SkipImageCheck = getenvBoolDefault("MKS_SKIP_IMAGE_CHECK", v.SkipImageCheck)
|
||||
|
||||
Reference in New Issue
Block a user