Skip to content

Commit

Permalink
operator: try fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaferraro committed Apr 7, 2022
1 parent 91b3fa3 commit 2de84dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/go/k8s/pkg/resources/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,8 @@ func (r *StatefulSetResource) getPreStopHook() *corev1.Handler {
curlGetCommand := r.composeCURLMaintenanceCommand(`--silent`, &genericMaintenancePath)
cmd := strings.Join(
[]string{
fmt.Sprintf(`until [ "${status:-}" = "200" ]; do status=$(%s); sleep 0.5; done`, curlCommand),
fmt.Sprintf(`until [ "${finished:-}" = "true" ]; do finished=$(%s | grep -o '\"finished\":[^,}]*' | grep -o '[^: ]*$'); sleep 0.5; done`, curlGetCommand),
fmt.Sprintf(`until [ "${status:-}" = "200" ] || [ "${status:-}" = "400" ]; do status=$(%s); sleep 0.5; done`, curlCommand),
fmt.Sprintf(`until [ "${status:-}" = "400" ] || [ "${finished:-}" = "true" ]; do finished=$(%s | grep -o '\"finished\":[^,}]*' | grep -o '[^: ]*$'); sleep 0.5; done`, curlGetCommand),
}, " && ")

return &corev1.Handler{
Expand Down

0 comments on commit 2de84dd

Please sign in to comment.