mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-21 01:26:28 +00:00
Merge pull request #21197 from yujuhong/deleted_pod
Auto commit by PR queue bot
This commit is contained in:
commit
f0b56409cc
@ -353,6 +353,11 @@ func (m *manager) syncBatch() {
|
|||||||
|
|
||||||
// syncPod syncs the given status with the API server. The caller must not hold the lock.
|
// syncPod syncs the given status with the API server. The caller must not hold the lock.
|
||||||
func (m *manager) syncPod(uid types.UID, status versionedPodStatus) {
|
func (m *manager) syncPod(uid types.UID, status versionedPodStatus) {
|
||||||
|
if !m.needsUpdate(uid, status) {
|
||||||
|
glog.V(1).Infof("Status for pod %q is up-to-date; skipping", uid)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: make me easier to express from client code
|
// TODO: make me easier to express from client code
|
||||||
pod, err := m.kubeClient.Core().Pods(status.podNamespace).Get(status.podName)
|
pod, err := m.kubeClient.Core().Pods(status.podNamespace).Get(status.podName)
|
||||||
if errors.IsNotFound(err) {
|
if errors.IsNotFound(err) {
|
||||||
@ -368,10 +373,6 @@ func (m *manager) syncPod(uid types.UID, status versionedPodStatus) {
|
|||||||
m.deletePodStatus(uid)
|
m.deletePodStatus(uid)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !m.needsUpdate(pod.UID, status) {
|
|
||||||
glog.V(1).Infof("Status for pod %q is up-to-date; skipping", format.Pod(pod))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
pod.Status = status.status
|
pod.Status = status.status
|
||||||
// TODO: handle conflict as a retry, make that easier too.
|
// TODO: handle conflict as a retry, make that easier too.
|
||||||
pod, err = m.kubeClient.Core().Pods(pod.Namespace).UpdateStatus(pod)
|
pod, err = m.kubeClient.Core().Pods(pod.Namespace).UpdateStatus(pod)
|
||||||
|
Loading…
Reference in New Issue
Block a user