Merge pull request #101093 from wzshiming/fix/startup-probe

Fix `startupProbe` behaviour changed
This commit is contained in:
Kubernetes Prow Robot 2021-04-19 18:54:32 -07:00 committed by GitHub
commit 7552ca9f56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View File

@ -250,8 +250,9 @@ func (w *worker) doProbe() (keepGoing bool) {
if c.Started != nil && *c.Started { if c.Started != nil && *c.Started {
// Stop probing for startup once container has 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 { if w.probeType == startup {
return false return true
} }
} else { } else {
// Disable other probes until container has started. // Disable other probes until container has started.

View File

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