Skip to content

Commit 43578f3

Browse files
committed
fix for restore if ReadOnlyRootFilesystem: true
1 parent 863420a commit 43578f3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

pkg/cluster/k8sres.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2250,6 +2250,13 @@ func addEmptyDirVolume(podSpec *v1.PodSpec, volumeName string, containerName str
22502250
podSpec.Containers[i].VolumeMounts = append(podSpec.Containers[i].VolumeMounts, mount)
22512251
}
22522252
}
2253+
if vol.Name == "postgres-tmp" && len(podSpec.InitContainers) > 0 {
2254+
for i := range podSpec.InitContainers {
2255+
if podSpec.InitContainers[i].Name == "pgbackrest-restore" {
2256+
podSpec.InitContainers[i].VolumeMounts = append(podSpec.InitContainers[i].VolumeMounts, mount)
2257+
}
2258+
}
2259+
}
22532260
}
22542261

22552262
func addRunVolume(podSpec *v1.PodSpec, volumeName string, containerName string, path string) {

0 commit comments

Comments
 (0)