1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-17 23:49:06 +00:00

Refactor cloud provider support

This commit is contained in:
galal-hussein
2018-06-06 19:11:47 +02:00
committed by Alena Prokharchyk
parent 676189a60d
commit 2142661ea7
10 changed files with 323 additions and 55 deletions

View File

@@ -11,6 +11,7 @@ import (
ref "github.com/docker/distribution/reference"
"github.com/docker/docker/api/types"
"github.com/rancher/rke/cloudprovider/aws"
"github.com/rancher/rke/docker"
"github.com/rancher/rke/hosts"
"github.com/rancher/rke/k8s"
@@ -129,7 +130,7 @@ func (c *Cluster) BuildKubeAPIProcess(prefixPath string) v3.Process {
"service-account-key-file": pki.GetKeyPath(pki.KubeAPICertName),
"apiserver-count": strconv.Itoa(apiserverCount),
}
if len(c.CloudProvider.Name) > 0 && c.CloudProvider.Name != AWSCloudProvider {
if len(c.CloudProvider.Name) > 0 && c.CloudProvider.Name != aws.AWSCloudProviderName {
CommandArgs["cloud-config"] = CloudConfigPath
}
// check if our version has specific options for this component
@@ -222,7 +223,7 @@ func (c *Cluster) BuildKubeControllerProcess(prefixPath string) v3.Process {
"service-account-private-key-file": pki.GetKeyPath(pki.KubeAPICertName),
"root-ca-file": pki.GetCertPath(pki.CACertName),
}
if len(c.CloudProvider.Name) > 0 && c.CloudProvider.Name != AWSCloudProvider {
if len(c.CloudProvider.Name) > 0 && c.CloudProvider.Name != aws.AWSCloudProviderName {
CommandArgs["cloud-config"] = CloudConfigPath
}
@@ -314,7 +315,7 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, prefixPath string) v3.Pr
if host.Address != host.InternalAddress {
CommandArgs["node-ip"] = host.InternalAddress
}
if len(c.CloudProvider.Name) > 0 && c.CloudProvider.Name != AWSCloudProvider {
if len(c.CloudProvider.Name) > 0 && c.CloudProvider.Name != aws.AWSCloudProviderName {
CommandArgs["cloud-config"] = CloudConfigPath
}