Skip to content

Commit ce1fee8

Browse files
authored
Ineffectual assignment of the envVars for connection pooler (#2165)
* Ineffectual assignment of the envVars for connection pooler * Fixed codegen in case of the GOPATH is specified explicitly
1 parent 021ab07 commit ce1fee8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

hack/update-codegen.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ trap "cleanup" EXIT SIGINT
1818
bash "${CODEGEN_PKG}/generate-groups.sh" all \
1919
"${OPERATOR_PACKAGE_ROOT}/pkg/generated" "${OPERATOR_PACKAGE_ROOT}/pkg/apis" \
2020
"acid.zalan.do:v1 zalando.org:v1" \
21-
--go-header-file "${SCRIPT_ROOT}"/hack/custom-boilerplate.go.txt
21+
--go-header-file "${SCRIPT_ROOT}"/hack/custom-boilerplate.go.txt \
22+
-o ./
2223

2324
cp -r "${OPERATOR_PACKAGE_ROOT}"/pkg/* "${TARGET_CODE_DIR}"
2425

pkg/cluster/connection_pooler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(role PostgresRole) (
324324
Protocol: v1.ProtocolTCP,
325325
},
326326
},
327-
Env: envVars,
328327
ReadinessProbe: &v1.Probe{
329328
ProbeHandler: v1.ProbeHandler{
330329
TCPSocket: &v1.TCPSocketAction{
@@ -341,7 +340,7 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(role PostgresRole) (
341340
// 1. Add environment variables to tell pgBouncer where to find the TLS certificates
342341
// 2. Reference the secret in a volume
343342
// 3. Mount the volume to the container at /tls
344-
poolerVolumes := []v1.Volume{}
343+
var poolerVolumes []v1.Volume
345344
if spec.TLS != nil && spec.TLS.SecretName != "" {
346345
// Env vars
347346
crtFile := spec.TLS.CertificateFile
@@ -383,6 +382,7 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(role PostgresRole) (
383382
}}
384383
}
385384

385+
poolerContainer.Env = envVars
386386
tolerationsSpec := tolerations(&spec.Tolerations, c.OpConfig.PodToleration)
387387

388388
podTemplate := &v1.PodTemplateSpec{

0 commit comments

Comments
 (0)