set secret name template via config map

This commit is contained in:
Murat Kabilov
2017-09-18 14:25:09 +02:00
parent 20ce38f585
commit d876f4d88e
4 changed files with 8 additions and 4 deletions
+6 -3
View File
@@ -331,9 +331,12 @@ func (c *Cluster) credentialSecretName(username string) string {
func (c *Cluster) credentialSecretNameForCluster(username string, clusterName string) string {
// secret must consist of lower case alphanumeric characters, '-' or '.',
// and must start and end with an alphanumeric character
return fmt.Sprintf(constants.UserSecretTemplate,
strings.Replace(username, "_", "-", -1),
clusterName)
return c.OpConfig.SecretNameTemplate.Format(
"username", strings.Replace(username, "_", "-", -1),
"clustername", clusterName,
"tprkind", constants.TPRKind,
"tprgroup", constants.TPRGroup)
}
func (c *Cluster) podSpiloRole(pod *v1.Pod) string {