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

Method createConnectionPooler

pkg/cluster/connection_pooler.go:159–168  ·  view source on GitHub ↗

Prepare the database for connection pooler to be used, i.e. install lookup function (do it first, because it should be fast and if it didn't succeed, it doesn't makes sense to create more K8S objects. At this moment we assume that necessary connection pooler user exists. After that create all the o

(LookupFunction InstallFunction)

Source from the content-addressed store, hash-verified

157// add these cp related functions to a new cp file
158// opConfig, cluster, and database name
159func (c *Cluster) createConnectionPooler(LookupFunction InstallFunction) (SyncReason, error) {
160 var reason SyncReason
161 c.setProcessName("creating connection pooler")
162
163 //this is essentially sync with nil as oldSpec
164 if reason, err := c.syncConnectionPooler(&acidv1.Postgresql{}, &c.Postgresql, LookupFunction); err != nil {
165 return reason, err
166 }
167 return reason, nil
168}
169
170// Generate pool size related environment variables.
171//

Callers 5

CreateMethod · 0.95
TestConnectionPoolerSyncFunction · 0.80
TestPodAnnotationsSyncFunction · 0.80

Calls 2

setProcessNameMethod · 0.95
syncConnectionPoolerMethod · 0.95

Tested by 4

TestConnectionPoolerSyncFunction · 0.64
TestPodAnnotationsSyncFunction · 0.64