Skip to content

Commit f2a80ac

Browse files
benjaminjbcbandy
authored andcommitted
Change pgbackrest init for running containers
In testing, we found that a running pgbackrest container wouldn't get the permissions adjusted with a mkdir; so we're switching to an install for now.
1 parent 836572d commit f2a80ac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/pgbackrest/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func MakePGBackrestLogDir(template *corev1.PodTemplateSpec,
152152
}
153153

154154
container := corev1.Container{
155-
Command: []string{"bash", "-c", "umask 000 && mkdir -m 777 -p " + pgBackRestLogPath},
155+
Command: []string{"bash", "-c", "umask 000 && install -m 777 -d " + pgBackRestLogPath},
156156
Image: config.PGBackRestContainerImage(cluster),
157157
ImagePullPolicy: cluster.Spec.ImagePullPolicy,
158158
Name: naming.ContainerPGBackRestLogDirInit,

internal/pgbackrest/config_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ func TestMakePGBackrestLogDir(t *testing.T) {
292292
for _, c := range podTemplate.Spec.InitContainers {
293293
if c.Name == naming.ContainerPGBackRestLogDirInit {
294294
// ignore "bash -c", should skip repo with no volume
295-
assert.Equal(t, "umask 000 && mkdir -m 777 -p /pgbackrest/repo2/log", c.Command[2])
295+
assert.Equal(t, "umask 000 && install -m 777 -d /pgbackrest/repo2/log", c.Command[2])
296296
assert.Equal(t, c.Image, "test-image")
297297
assert.Equal(t, c.ImagePullPolicy, corev1.PullAlways)
298298
assert.Assert(t, !cmp.DeepEqual(c.SecurityContext,

0 commit comments

Comments
 (0)