mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Merge pull request #92196 from thockin/startup-probe-blocks-readiness
Pods which have not "started" can not be "ready"
This commit is contained in:
commit
78b503d9f8
@ -235,18 +235,6 @@ func (m *manager) CleanupPods(desiredPods map[types.UID]sets.Empty) {
|
||||
|
||||
func (m *manager) UpdatePodStatus(podUID types.UID, podStatus *v1.PodStatus) {
|
||||
for i, c := range podStatus.ContainerStatuses {
|
||||
var ready bool
|
||||
if c.State.Running == nil {
|
||||
ready = false
|
||||
} else if result, ok := m.readinessManager.Get(kubecontainer.ParseContainerID(c.ContainerID)); ok {
|
||||
ready = result == results.Success
|
||||
} else {
|
||||
// The check whether there is a probe which hasn't run yet.
|
||||
_, exists := m.getWorker(podUID, c.Name, readiness)
|
||||
ready = !exists
|
||||
}
|
||||
podStatus.ContainerStatuses[i].Ready = ready
|
||||
|
||||
var started bool
|
||||
if c.State.Running == nil {
|
||||
started = false
|
||||
@ -261,6 +249,20 @@ func (m *manager) UpdatePodStatus(podUID types.UID, podStatus *v1.PodStatus) {
|
||||
started = !exists
|
||||
}
|
||||
podStatus.ContainerStatuses[i].Started = &started
|
||||
|
||||
if started {
|
||||
var ready bool
|
||||
if c.State.Running == nil {
|
||||
ready = false
|
||||
} else if result, ok := m.readinessManager.Get(kubecontainer.ParseContainerID(c.ContainerID)); ok {
|
||||
ready = result == results.Success
|
||||
} else {
|
||||
// The check whether there is a probe which hasn't run yet.
|
||||
_, exists := m.getWorker(podUID, c.Name, readiness)
|
||||
ready = !exists
|
||||
}
|
||||
podStatus.ContainerStatuses[i].Ready = ready
|
||||
}
|
||||
}
|
||||
// init containers are ready if they have exited with success or if a readiness probe has
|
||||
// succeeded.
|
||||
|
Loading…
Reference in New Issue
Block a user