add pooler suffix to DNS annotation of pooler LoadBalancer service (#2188)

* add pooler suffix to DNS annotation of pooler LoadBalancer service
* need generatePoolerServiceAnnotations function
This commit is contained in:
Felix Kunde
2023-01-27 12:07:48 +01:00
committed by GitHub
parent 7887ebbbce
commit c9cada66c7
7 changed files with 93 additions and 38 deletions
+6 -6
View File
@@ -509,9 +509,9 @@ func (c *Cluster) dnsName(role PostgresRole) string {
var dnsString, oldDnsString string
if role == Master {
dnsString = c.masterDNSName()
dnsString = c.masterDNSName(c.Name)
} else {
dnsString = c.replicaDNSName()
dnsString = c.replicaDNSName(c.Name)
}
// if cluster name starts with teamID we might need to provide backwards compatibility
@@ -528,17 +528,17 @@ func (c *Cluster) dnsName(role PostgresRole) string {
return dnsString
}
func (c *Cluster) masterDNSName() string {
func (c *Cluster) masterDNSName(clusterName string) string {
return strings.ToLower(c.OpConfig.MasterDNSNameFormat.Format(
"cluster", c.Name,
"cluster", clusterName,
"namespace", c.Namespace,
"team", c.teamName(),
"hostedzone", c.OpConfig.DbHostedZone))
}
func (c *Cluster) replicaDNSName() string {
func (c *Cluster) replicaDNSName(clusterName string) string {
return strings.ToLower(c.OpConfig.ReplicaDNSNameFormat.Format(
"cluster", c.Name,
"cluster", clusterName,
"namespace", c.Namespace,
"team", c.teamName(),
"hostedzone", c.OpConfig.DbHostedZone))