Merge pull request #8002 from srikiz/DO-7956-FixEtcdNameLogic

[Issue-7956] - [Digital Ocean] Minor fix to have proper indexing for digital ocean regions
This commit is contained in:
Kubernetes Prow Robot 2019-12-05 07:42:32 -08:00 committed by GitHub
commit e11f394f05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -726,8 +726,14 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
for i := 0; i < int(masterCount); i++ {
zone := masterZones[i%len(masterZones)]
name := zone
if int(masterCount) > len(masterZones) {
name += "-" + strconv.Itoa(1+(i/len(masterZones)))
if api.CloudProviderID(cluster.Spec.CloudProvider) == api.CloudProviderDO {
if int(masterCount) >= len(masterZones) {
name += "-" + strconv.Itoa(1+(i/len(masterZones)))
}
} else {
if int(masterCount) > len(masterZones) {
name += "-" + strconv.Itoa(1+(i/len(masterZones)))
}
}
g := &api.InstanceGroup{}