Skip to content

Commit 7d064b9

Browse files
committed
fixup! fixup! test: add/update tests related to postStart hook commands
Signed-off-by: Oleksii Kurinnyi <[email protected]>
1 parent c0ee548 commit 7d064b9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/library/status/check.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ import (
3333

3434
var (
3535
// reTerminatedSigterm matches: "[postStart hook] Commands terminated by SIGTERM (likely timed out after ...s). Exit code 143."
36-
reTerminatedSigterm = regexp.MustCompile(`(\\[postStart hook\\] Commands terminated by SIGTERM \\(likely timed out after [^)]+?\\)\\. Exit code 143\\.)`)
36+
reTerminatedSigterm = regexp.MustCompile(`\[postStart hook\] Commands terminated by SIGTERM \(likely timed out after \d+[^\)]+?\)\. Exit code 143\.`)
3737

3838
// reKilledSigkill matches: "[postStart hook] Commands forcefully killed by SIGKILL (likely after --kill-after ...s expired). Exit code 137."
39-
reKilledSigkill = regexp.MustCompile(`(\\[postStart hook\\] Commands forcefully killed by SIGKILL \\(likely after --kill-after [^)]+?\\)\\. Exit code 137\\.)`)
39+
reKilledSigkill = regexp.MustCompile(`\[postStart hook\] Commands forcefully killed by SIGKILL \(likely after --kill-after \d+[^\)]+?\)\. Exit code 137\.`)
4040

4141
// reGenericFailedExitCode matches: "[postStart hook] Commands failed with exit code ..." (for any other script-reported non-zero exit code)
42-
reGenericFailedExitCode = regexp.MustCompile(`(\\[postStart hook\\] Commands failed with exit code \\d+\\.)`)
42+
reGenericFailedExitCode = regexp.MustCompile(`\[postStart hook\] Commands failed with exit code \d+\.`)
4343

4444
// reKubeletInternalMessage regex to capture Kubelet's explicit message field content if it exists
45-
reKubeletInternalMessage = regexp.MustCompile(`message:\\s*"([^"]*)"`)
45+
reKubeletInternalMessage = regexp.MustCompile(`message:\s*"([^"]*)"`)
4646

4747
// reKubeletExitCode regex to capture Kubelet's reported exit code for the hook command
48-
reKubeletExitCode = regexp.MustCompile(`exited with (\\d+):`)
48+
reKubeletExitCode = regexp.MustCompile(`exited with (\d+):`)
4949
)
5050

5151
var containerFailureStateReasons = []string{

0 commit comments

Comments
 (0)