Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
k8sutil: extend rand suffix length to 10
Browse files Browse the repository at this point in the history
  • Loading branch information
hongchaodeng committed Jan 24, 2018
1 parent 75306f9 commit 1fff44a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/util/k8sutil/k8sutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ const (
serverTLSVolume = "member-server-tls"
operatorEtcdTLSDir = "/etc/etcdtls/operator/etcd-tls"
operatorEtcdTLSVolume = "etcd-client-tls"

randomSuffixLength = 10
)

const TolerateUnreadyEndpointsAnnotation = "service.alpha.kubernetes.io/tolerate-unready-endpoints"
Expand Down Expand Up @@ -474,5 +476,6 @@ func mergeLabels(l1, l2 map[string]string) {
}

func UniqueMemberName(clusterName string) string {
return fmt.Sprintf("%s-%s", clusterName, utilrand.String(5))
suffix := utilrand.String(randomSuffixLength)
return clusterName + "-" + suffix
}

0 comments on commit 1fff44a

Please sign in to comment.