mirror of
https://github.com/rancher/rke.git
synced 2025-04-27 19:25:44 +00:00
Support to accpet new Windows service options
**Issue:** https://github.com/rancher/rancher/issues/22470
This commit is contained in:
parent
96802dfc72
commit
0a170b22b7
@ -124,12 +124,16 @@ func (c *Cluster) DeployControlPlane(ctx context.Context, svcOptions *v3.Kuberne
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Cluster) DeployWorkerPlane(ctx context.Context, svcOptions *v3.KubernetesServicesOptions) error {
|
||||
func (c *Cluster) DeployWorkerPlane(ctx context.Context, linuxSvcOptions *v3.KubernetesServicesOptions, windowsSvcOptions *v3.KubernetesServicesOptions) error {
|
||||
// Deploy Worker plane
|
||||
workerNodePlanMap := make(map[string]v3.RKEConfigNodePlan)
|
||||
// Build cp node plan map
|
||||
allHosts := hosts.GetUniqueHostList(c.EtcdHosts, c.ControlPlaneHosts, c.WorkerHosts)
|
||||
for _, workerHost := range allHosts {
|
||||
svcOptions := linuxSvcOptions
|
||||
if workerHost.DockerInfo.OSType == "windows" { // compatible with Windows
|
||||
svcOptions = windowsSvcOptions
|
||||
}
|
||||
workerNodePlanMap[workerHost.Address] = BuildRKEConfigNodePlan(ctx, c, workerHost, workerHost.DockerInfo, svcOptions)
|
||||
}
|
||||
if err := services.RunWorkerPlane(ctx, allHosts,
|
||||
|
@ -166,7 +166,8 @@ func ClusterUp(ctx context.Context, dialersOptions hosts.DialersOptions, flags c
|
||||
return APIURL, caCrt, clientCert, clientKey, nil, err
|
||||
}
|
||||
|
||||
err = kubeCluster.DeployWorkerPlane(ctx, svcOptions)
|
||||
windowsSvcOptions, _ := data["k8s-windows-service-options"].(*v3.KubernetesServicesOptions)
|
||||
err = kubeCluster.DeployWorkerPlane(ctx, svcOptions, windowsSvcOptions)
|
||||
if err != nil {
|
||||
return APIURL, caCrt, clientCert, clientKey, nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user