Merge pull request #7655 from mikesplain/automated-cherry-pick-of-#7641-origin-release-1.14

Automated cherry pick of #7641: fix instance name
This commit is contained in:
Kubernetes Prow Robot 2019-09-23 11:01:24 -07:00 committed by GitHub
commit 90a9e55cd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -83,8 +83,8 @@ func (b *ServerGroupModelBuilder) buildInstances(c *fi.ModelBuilderContext, sg *
return fmt.Errorf("Failed to create UUID for instance: %v", err)
}
// FIXME: Must ensure 63 or less characters
// replace all dots with -, this is needed to get external cloudprovider working
iName := strings.ToLower(fmt.Sprintf("%s-%d.%s", ig.Name, i+1, b.ClusterName()))
// replace all dots and _ with -, this is needed to get external cloudprovider working
iName := strings.Replace(strings.ToLower(fmt.Sprintf("%s-%d.%s", ig.Name, i+1, b.ClusterName())), "_", "-", -1)
instanceName := fi.String(strings.Replace(iName, ".", "-", -1))
securityGroupName := b.SecurityGroupName(ig.Spec.Role)