Add team name to tpr object metadata name

This commit is contained in:
Murat Kabilov
2017-05-12 11:41:33 +02:00
parent db53134cbd
commit dd2ed5ff9d
6 changed files with 32 additions and 7 deletions
+1 -2
View File
@@ -9,7 +9,6 @@ import (
"k8s.io/client-go/pkg/util/intstr"
"github.bus.zalan.do/acid/postgres-operator/pkg/spec"
"github.bus.zalan.do/acid/postgres-operator/pkg/util"
"github.bus.zalan.do/acid/postgres-operator/pkg/util/constants"
)
@@ -243,7 +242,7 @@ func (c *Cluster) genService(allowedSourceRanges []string) *v1.Service {
Namespace: c.Metadata.Namespace,
Labels: c.labelsSet(),
Annotations: map[string]string{
constants.ZalandoDnsNameAnnotation: util.ClusterDNSName(c.Metadata.Name, c.TeamName(), c.OpConfig.DbHostedZone),
constants.ZalandoDnsNameAnnotation: c.dnsName(),
},
},
Spec: v1.ServiceSpec{
+8
View File
@@ -209,6 +209,14 @@ func (c *Cluster) labelsSet() labels.Set {
}
}
func (c *Cluster) dnsName() string {
return strings.ToLower(fmt.Sprintf(
c.OpConfig.DNSFormat,
c.Spec.ClusterName,
c.TeamName(),
c.OpConfig.DbHostedZone))
}
func (c *Cluster) credentialSecretName(username string) string {
return fmt.Sprintf(constants.UserSecretTemplate,
username,