Skip to content

Commit

Permalink
Avoid space in the load balancer name
Browse files Browse the repository at this point in the history
  • Loading branch information
yaocw2020 authored and guangbochen committed Apr 7, 2022
1 parent fdffd63 commit c6c6810
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cloud-controller-manager/loadBalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (l *LoadBalancerManager) GetLoadBalancerName(ctx context.Context, clusterNa
name := clusterName + "-" + service.Namespace + "-" + service.Name + "-"

digest := crc32.ChecksumIEEE([]byte(name + string(service.UID)))
suffix := fmt.Sprintf("%8x", digest)
suffix := fmt.Sprintf("%08x", digest) // print in 8 width and pad with 0's
name += suffix

// The name of a Service object must be a valid [RFC 1035 label name](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names)
Expand Down

0 comments on commit c6c6810

Please sign in to comment.