Optimize template constant

This commit is contained in:
Murat Kabilov 2017-05-10 16:06:07 +02:00
parent fd449342e5
commit 18700b9ef7
2 changed files with 2 additions and 4 deletions

View File

@ -257,9 +257,7 @@ func (c *Cluster) credentialSecretName(username string) string {
// and must start and end with an alphanumeric character
return fmt.Sprintf(constants.UserSecretTemplate,
strings.Replace(username, "_", "-", -1),
c.Metadata.Name,
constants.TPRName,
constants.TPRVendor)
c.Metadata.Name)
}
func (c *Cluster) deleteEtcdKey() error {

View File

@ -12,7 +12,7 @@ const (
K8sApiPath = "/api"
DataVolumeName = "pgdata"
PasswordLength = 64
UserSecretTemplate = "%s.%s.credentials.%s.%s" // Username, ClusterName, TPRName, TPRVendor
UserSecretTemplate = "%s.%s.credentials." + TPRName + "." + TPRVendor // Username, ClusterName
ZalandoDnsNameAnnotation = "external-dns.alpha.kubernetes.io/hostname"
ElbTimeoutAnnotationName = "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout"
ElbTimeoutAnnotationValue = "3600"