Merge pull request #63686 from dougm/deprecate-photon

Automatic merge from submit-queue (batch tested with PRs 63686, 63736). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Deprecate photon cloud provider

vmware/photon-controller is no longer maintained, as of Oct 2017.

Adds a detail field to deprecatedCloudProviders, meant for pointing to external provider url or other reason for deprecation.



**What this PR does / why we need it**:

The photon cloud provider is no longer supported, need to let users know.

Photon controller support has already been removed from kube-up in PR #58096

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-05-11 19:09:15 -07:00 committed by GitHub
commit f7ccaae269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,8 +35,13 @@ type Factory func(config io.Reader) (Interface, error)
var (
providersMutex sync.Mutex
providers = make(map[string]Factory)
deprecatedCloudProviders = []string{
"openstack",
deprecatedCloudProviders = []struct {
name string
external bool
detail string
}{
{"openstack", true, "https://github.com/kubernetes/cloud-provider-openstack"},
{"photon", false, "The Photon Controller project is no longer maintained."},
}
)
@ -99,9 +104,13 @@ func InitCloudProvider(name string, configFilePath string) (Interface, error) {
}
for _, provider := range deprecatedCloudProviders {
if provider == name {
glog.Warningf("WARNING: %s built-in cloud provider is now deprecated. "+
"Please use 'external' cloud provider for %s", name, name)
if provider.name == name {
detail := provider.detail
if provider.external {
detail = fmt.Sprintf("Please use 'external' cloud provider for %s: %s", name, provider.detail)
}
glog.Warningf("WARNING: %s built-in cloud provider is now deprecated. %s", name, detail)
break
}
}