Skip to content

Commit a6beb66

Browse files
authored
Ensure standby cluster creates pgBouncer Secret
The code was not allowing for this to happen. Even though the pgBouncer credential will need to be rotated after a standby is promoted, we can still create the credential with a nonworking default. Issue: [ch10083]
1 parent 3c51430 commit a6beb66

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/operator/cluster/pgbouncer.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ func AddPgbouncer(clientset kubernetes.Interface, restconfig *rest.Config, clust
164164
if err := setPostgreSQLPassword(clientset, restconfig, pod, cluster.Spec.Port, crv1.PGUserPgBouncer, pgBouncerPassword); err != nil {
165165
return err
166166
}
167+
} else {
168+
// if this is a standby cluster, we still need to create a pgBouncer Secret,
169+
// but no credentials are available
170+
if err := createPgbouncerSecret(clientset, cluster, ""); err != nil {
171+
return err
172+
}
167173
}
168174

169175
// next, create the pgBouncer config map that will allow pgBouncer to be

0 commit comments

Comments
 (0)