Handle empty clusterID in loadbalancer naming

This commit is contained in:
Pavithra Ramesh 2018-06-12 10:45:34 -07:00
parent c2848da107
commit 2d10c8a066

View File

@ -31,7 +31,12 @@ import (
// Instance groups remain legacy named to stay consistent with ingress
func makeInstanceGroupName(clusterID string) string {
return fmt.Sprintf("k8s-ig--%s", clusterID)
prefix := "k8s-ig"
// clusterID might be empty for legacy clusters
if clusterID == "" {
return prefix
}
return fmt.Sprintf("%s--%s", prefix, clusterID)
}
func makeBackendServiceName(loadBalancerName, clusterID string, shared bool, scheme cloud.LbScheme, protocol v1.Protocol, svcAffinity v1.ServiceAffinity) string {