Skip to content

Commit 9be2645

Browse files
committed
use bash -c for the probes to work properly
1 parent 7f5625f commit 9be2645

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

internal/patroni/reconcile.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func instanceProbes(cluster *v1beta1.PostgresCluster, container *corev1.Containe
149149
container.LivenessProbe = probeTiming(cluster.Spec.Patroni)
150150
container.LivenessProbe.InitialDelaySeconds = 3
151151
container.LivenessProbe.Exec = &corev1.ExecAction{
152-
Command: []string{"/usr/local/bin/postgres-liveness-check.sh"},
152+
Command: []string{"bash", "-c", "/usr/local/bin/postgres-liveness-check.sh"},
153153
}
154154

155155
// Readiness is reflected in the controlling object's status (e.g. ReadyReplicas)
@@ -160,7 +160,7 @@ func instanceProbes(cluster *v1beta1.PostgresCluster, container *corev1.Containe
160160
container.ReadinessProbe = probeTiming(cluster.Spec.Patroni)
161161
container.ReadinessProbe.InitialDelaySeconds = 3
162162
container.ReadinessProbe.Exec = &corev1.ExecAction{
163-
Command: []string{"/usr/local/bin/postgres-readiness-check.sh"},
163+
Command: []string{"bash", "-c", "/usr/local/bin/postgres-readiness-check.sh"},
164164
}
165165
}
166166

internal/patroni/reconcile_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ containers:
178178
livenessProbe:
179179
exec:
180180
command:
181+
- bash
182+
- -c
181183
- /usr/local/bin/postgres-liveness-check.sh
182184
failureThreshold: 3
183185
initialDelaySeconds: 3
@@ -188,6 +190,8 @@ containers:
188190
readinessProbe:
189191
exec:
190192
command:
193+
- bash
194+
- -c
191195
- /usr/local/bin/postgres-readiness-check.sh
192196
failureThreshold: 3
193197
initialDelaySeconds: 3

0 commit comments

Comments
 (0)