MCPcopy Index your code
hub / github.com/zalando/postgres-operator / pgConnectionString

Method pgConnectionString

pkg/cluster/database.go:97–110  ·  view source on GitHub ↗
(dbname string)

Source from the content-addressed store, hash-verified

95)
96
97func (c *Cluster) pgConnectionString(dbname string) string {
98 password := c.systemUsers[constants.SuperuserKeyName].Password
99
100 if dbname == "" {
101 dbname = "postgres"
102 }
103
104 return fmt.Sprintf("host='%s' dbname='%s' sslmode=require user='%s' password='%s' connect_timeout='%d'",
105 fmt.Sprintf("%s.%s.svc.%s", c.Name, c.Namespace, c.OpConfig.ClusterDomain),
106 dbname,
107 c.systemUsers[constants.SuperuserKeyName].Name,
108 strings.Replace(password, "$", "\\$", -1),
109 constants.PostgresConnectTimeout/time.Second)
110}
111
112func (c *Cluster) databaseAccessDisabled() bool {
113 if !c.OpConfig.EnableDBAccess {

Callers 1

initDbConnWithNameMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected