File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ func WALStorage(instance *v1beta1.PostgresInstanceSetSpec) string {
117117// Environment returns the environment variables required to invoke PostgreSQL
118118// utilities.
119119func Environment (cluster * v1beta1.PostgresCluster ) []corev1.EnvVar {
120- return []corev1.EnvVar {
120+ env := []corev1.EnvVar {
121121 // - https://www.postgresql.org/docs/current/reference-server.html
122122 {
123123 Name : "PGDATA" ,
@@ -146,6 +146,9 @@ func Environment(cluster *v1beta1.PostgresCluster) []corev1.EnvVar {
146146 Name : "KRB5RCACHEDIR" ,
147147 Value : "/tmp" ,
148148 },
149+ }
150+
151+ if cluster .CompareVersion ("2.6.0" ) >= 0 {
149152 // This allows a custom CA certificate to be mounted for Postgres LDAP
150153 // authentication via spec.config.files.
151154 // - https://wiki.postgresql.org/wiki/LDAP_Authentication_against_AD
@@ -155,11 +158,13 @@ func Environment(cluster *v1beta1.PostgresCluster) []corev1.EnvVar {
155158 // - https://www.openldap.org/software/man.cgi?query=ldap.conf
156159 //
157160 // Testing with LDAPTLS_CACERTDIR did not work as expected during testing.
158- {
161+ env = append ( env , corev1. EnvVar {
159162 Name : "LDAPTLS_CACERT" ,
160163 Value : configMountPath + "/ldap/ca.crt" ,
161- },
164+ })
162165 }
166+
167+ return env
163168}
164169
165170// reloadCommand returns an entrypoint that convinces PostgreSQL to reload
You can’t perform that action at this time.
0 commit comments