mirror of
https://github.com/rancher/rke.git
synced 2025-07-11 06:13:24 +00:00
Remove ServiceOption if empty
This commit is contained in:
parent
0dbe06d631
commit
d4759bcc4f
@ -160,6 +160,11 @@ func (c *Cluster) BuildKubeAPIProcess(prefixPath string) v3.Process {
|
|||||||
serviceOptions := c.GetKubernetesServicesOptions()
|
serviceOptions := c.GetKubernetesServicesOptions()
|
||||||
if serviceOptions.KubeAPI != nil {
|
if serviceOptions.KubeAPI != nil {
|
||||||
for k, v := range serviceOptions.KubeAPI {
|
for k, v := range serviceOptions.KubeAPI {
|
||||||
|
// if the value is empty, we remove that option
|
||||||
|
if len(v) == 0 {
|
||||||
|
delete(CommandArgs, k)
|
||||||
|
continue
|
||||||
|
}
|
||||||
CommandArgs[k] = v
|
CommandArgs[k] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -259,6 +264,11 @@ func (c *Cluster) BuildKubeControllerProcess(prefixPath string) v3.Process {
|
|||||||
serviceOptions := c.GetKubernetesServicesOptions()
|
serviceOptions := c.GetKubernetesServicesOptions()
|
||||||
if serviceOptions.KubeController != nil {
|
if serviceOptions.KubeController != nil {
|
||||||
for k, v := range serviceOptions.KubeController {
|
for k, v := range serviceOptions.KubeController {
|
||||||
|
// if the value is empty, we remove that option
|
||||||
|
if len(v) == 0 {
|
||||||
|
delete(CommandArgs, k)
|
||||||
|
continue
|
||||||
|
}
|
||||||
CommandArgs[k] = v
|
CommandArgs[k] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -320,7 +330,7 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, prefixPath string) v3.Pr
|
|||||||
CommandArgs := map[string]string{
|
CommandArgs := map[string]string{
|
||||||
"v": "2",
|
"v": "2",
|
||||||
"address": "0.0.0.0",
|
"address": "0.0.0.0",
|
||||||
"cadvisor-port": "0",
|
"cadvisor-port": "0", //depricated in 1.12
|
||||||
"read-only-port": "0",
|
"read-only-port": "0",
|
||||||
"cluster-domain": c.ClusterDomain,
|
"cluster-domain": c.ClusterDomain,
|
||||||
"pod-infra-container-image": c.Services.Kubelet.InfraContainerImage,
|
"pod-infra-container-image": c.Services.Kubelet.InfraContainerImage,
|
||||||
@ -371,6 +381,11 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, prefixPath string) v3.Pr
|
|||||||
serviceOptions := c.GetKubernetesServicesOptions()
|
serviceOptions := c.GetKubernetesServicesOptions()
|
||||||
if serviceOptions.Kubelet != nil {
|
if serviceOptions.Kubelet != nil {
|
||||||
for k, v := range serviceOptions.Kubelet {
|
for k, v := range serviceOptions.Kubelet {
|
||||||
|
// if the value is empty, we remove that option
|
||||||
|
if len(v) == 0 {
|
||||||
|
delete(CommandArgs, k)
|
||||||
|
continue
|
||||||
|
}
|
||||||
CommandArgs[k] = v
|
CommandArgs[k] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -458,6 +473,11 @@ func (c *Cluster) BuildKubeProxyProcess(host *hosts.Host, prefixPath string) v3.
|
|||||||
serviceOptions := c.GetKubernetesServicesOptions()
|
serviceOptions := c.GetKubernetesServicesOptions()
|
||||||
if serviceOptions.Kubeproxy != nil {
|
if serviceOptions.Kubeproxy != nil {
|
||||||
for k, v := range serviceOptions.Kubeproxy {
|
for k, v := range serviceOptions.Kubeproxy {
|
||||||
|
// if the value is empty, we remove that option
|
||||||
|
if len(v) == 0 {
|
||||||
|
delete(CommandArgs, k)
|
||||||
|
continue
|
||||||
|
}
|
||||||
CommandArgs[k] = v
|
CommandArgs[k] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -550,6 +570,11 @@ func (c *Cluster) BuildSchedulerProcess(prefixPath string) v3.Process {
|
|||||||
serviceOptions := c.GetKubernetesServicesOptions()
|
serviceOptions := c.GetKubernetesServicesOptions()
|
||||||
if serviceOptions.Scheduler != nil {
|
if serviceOptions.Scheduler != nil {
|
||||||
for k, v := range serviceOptions.Scheduler {
|
for k, v := range serviceOptions.Scheduler {
|
||||||
|
// if the value is empty, we remove that option
|
||||||
|
if len(v) == 0 {
|
||||||
|
delete(CommandArgs, k)
|
||||||
|
continue
|
||||||
|
}
|
||||||
CommandArgs[k] = v
|
CommandArgs[k] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user