mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-06 19:12:31 +02:00
Add team name to tpr object metadata name
This commit is contained in:
@@ -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{
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user