mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Merge pull request #18410 from Random-Liu/reconcile-pod-status
Auto commit by PR queue bot
This commit is contained in:
@@ -130,6 +130,7 @@ type SyncHandler interface {
|
||||
HandlePodAdditions(pods []*api.Pod)
|
||||
HandlePodUpdates(pods []*api.Pod)
|
||||
HandlePodDeletions(pods []*api.Pod)
|
||||
HandlePodReconcile(pods []*api.Pod)
|
||||
HandlePodSyncs(pods []*api.Pod)
|
||||
HandlePodCleanups() error
|
||||
}
|
||||
@@ -2335,6 +2336,9 @@ func (kl *Kubelet) syncLoopIteration(updates <-chan kubetypes.PodUpdate, handler
|
||||
case kubetypes.REMOVE:
|
||||
glog.V(2).Infof("SyncLoop (REMOVE, %q): %q", u.Source, format.Pods(u.Pods))
|
||||
handler.HandlePodDeletions(u.Pods)
|
||||
case kubetypes.RECONCILE:
|
||||
glog.V(4).Infof("SyncLoop (RECONCILE, %q): %q", u.Source, format.Pods(u.Pods))
|
||||
handler.HandlePodReconcile(u.Pods)
|
||||
case kubetypes.SET:
|
||||
// TODO: Do we want to support this?
|
||||
glog.Errorf("Kubelet does not support snapshot update")
|
||||
@@ -2469,6 +2473,14 @@ func (kl *Kubelet) HandlePodDeletions(pods []*api.Pod) {
|
||||
}
|
||||
}
|
||||
|
||||
func (kl *Kubelet) HandlePodReconcile(pods []*api.Pod) {
|
||||
for _, pod := range pods {
|
||||
// Update the pod in pod manager, status manager will do periodically reconcile according
|
||||
// to the pod manager.
|
||||
kl.podManager.UpdatePod(pod)
|
||||
}
|
||||
}
|
||||
|
||||
func (kl *Kubelet) HandlePodSyncs(pods []*api.Pod) {
|
||||
start := kl.clock.Now()
|
||||
for _, pod := range pods {
|
||||
|
||||
Reference in New Issue
Block a user