mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-03 19:02:12 +02:00
database.go: remove hardcoded .svc.cluster.local dns suffix (#561)
* database.go: substitute hardcoded .svc.cluster.local dns suffix with config parameter Use the pod's configured dns search path, for clusters where .svc.cluster.local is not correct.
This commit is contained in:
committed by
Sergey Dudoladov
parent
3ffc8ac5fa
commit
ebda39368e
@@ -34,7 +34,7 @@ func (c *Cluster) pgConnectionString() string {
|
||||
password := c.systemUsers[constants.SuperuserKeyName].Password
|
||||
|
||||
return fmt.Sprintf("host='%s' dbname=postgres sslmode=require user='%s' password='%s' connect_timeout='%d'",
|
||||
fmt.Sprintf("%s.%s.svc.cluster.local", c.Name, c.Namespace),
|
||||
fmt.Sprintf("%s.%s.svc.%s", c.Name, c.Namespace, c.OpConfig.ClusterDomain),
|
||||
c.systemUsers[constants.SuperuserKeyName].Name,
|
||||
strings.Replace(password, "$", "\\$", -1),
|
||||
constants.PostgresConnectTimeout/time.Second)
|
||||
|
||||
Reference in New Issue
Block a user