Merge pull request #47038 from yastij/DefaultExternalHost-for-registredCP

Automatic merge from submit-queue (batch tested with PRs 47038, 47105)

extending DefaultExternalHost for any registred cloud provider

**What this PR does / why we need it**: this PR enables DefaultExternalHost to work with any registered cloud provider.

**Which issue this PR fixes** : fixes #46567 

**Special notes for your reviewer**:

**Release note**:

```release-note
When determining the default external host of the kube apiserver, any configured cloud provider is now consulted
```
pull/6/head
Kubernetes Submit Queue 2017-06-27 08:29:25 -07:00 committed by GitHub
commit 6acfb0f868
1 changed files with 1 additions and 2 deletions

View File

@ -54,8 +54,7 @@ func (s *CloudProviderOptions) DefaultExternalHost(genericoptions *genericoption
return nil
}
// TODO: extend for other providers
if s.CloudProvider == "gce" || s.CloudProvider == "aws" {
if cloudprovider.IsCloudProvider(s.CloudProvider) {
cloud, err := cloudprovider.InitCloudProvider(s.CloudProvider, s.CloudConfigFile)
if err != nil {
return fmt.Errorf("%q cloud provider could not be initialized: %v", s.CloudProvider, err)