mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-01 01:08:55 +00:00
Merge pull request #5444 from vmarmol/lock
Lock access and update to Kubelet pods.
This commit is contained in:
@@ -1695,6 +1695,8 @@ func (kl *Kubelet) syncLoop(updates <-chan PodUpdate, handler SyncHandler) {
|
|||||||
// Updated the Kubelet's internal pods with those provided by the update.
|
// Updated the Kubelet's internal pods with those provided by the update.
|
||||||
// Records new and updated pods in newPods and updatedPods.
|
// Records new and updated pods in newPods and updatedPods.
|
||||||
func (kl *Kubelet) updatePods(u PodUpdate, podSyncTypes map[types.UID]metrics.SyncPodType) {
|
func (kl *Kubelet) updatePods(u PodUpdate, podSyncTypes map[types.UID]metrics.SyncPodType) {
|
||||||
|
kl.podLock.Lock()
|
||||||
|
defer kl.podLock.Unlock()
|
||||||
switch u.Op {
|
switch u.Op {
|
||||||
case SET:
|
case SET:
|
||||||
glog.V(3).Infof("SET: Containers changed")
|
glog.V(3).Infof("SET: Containers changed")
|
||||||
|
Reference in New Issue
Block a user