Skip to content

Commit 48ea7d5

Browse files
committed
add ENV to ensure patroni can find postgres.yml if ReadOnlyRootFilesystem is true
1 parent 43578f3 commit 48ea7d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/cluster/k8sres.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,10 @@ func (c *Cluster) generateSpiloPodEnvVars(
10241024
envVars = append(envVars, v1.EnvVar{Name: "USE_PGBACKREST", Value: "true"})
10251025
}
10261026

1027+
if c.OpConfig.ReadOnlyRootFilesystem != nil && *c.OpConfig.ReadOnlyRootFilesystem {
1028+
envVars = append(envVars, v1.EnvVar{Name: "HOME", Value: "/home/postgres"})
1029+
}
1030+
10271031
if spec.TDE != nil && spec.TDE.Enable {
10281032
envVars = append(envVars, v1.EnvVar{Name: "TDE", Value: "true"})
10291033
// envVars = append(envVars, v1.EnvVar{Name: "PGENCRKEYCMD", Value: "/tmp/tde.sh"})

0 commit comments

Comments
 (0)