Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated cherry pick of #101093: Fix startupProbe behaviour changed #101224

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/kubelet/prober/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,9 @@ func (w *worker) doProbe() (keepGoing bool) {

if c.Started != nil && *c.Started {
// Stop probing for startup once container has started.
// we keep it running to make sure it will work for restarted container.
if w.probeType == startup {
return false
return true
}
} else {
// Disable other probes until container has started.
Expand Down
8 changes: 1 addition & 7 deletions pkg/kubelet/prober/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,6 @@ func expectContinue(t *testing.T, w *worker, c bool, msg string) {
}
}

func expectStop(t *testing.T, w *worker, c bool, msg string) {
if c {
t.Errorf("[%s - %s] Expected to stop, but did not", w.probeType, msg)
}
}

func resultsManager(m *manager, probeType probeType) results.Manager {
switch probeType {
case readiness:
Expand Down Expand Up @@ -508,6 +502,6 @@ func TestStartupProbeDisabledByStarted(t *testing.T) {
// startupProbe fails, but is disabled
m.prober.exec = fakeExecProber{probe.Failure, nil}
msg = "Started, probe failure, result success"
expectStop(t, w, w.doProbe(), msg)
expectContinue(t, w, w.doProbe(), msg)
expectResult(t, w, results.Success, msg)
}