mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #1616 from brendandburns/kubelet
Fix a problem with for loops, copy semantics and async routines.
This commit is contained in:
commit
b2dd4acc43
@ -635,8 +635,9 @@ func (kl *Kubelet) SyncPods(pods []Pod) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for any containers that need starting
|
// Check for any containers that need starting
|
||||||
for _, pod := range pods {
|
for ix := range pods {
|
||||||
podFullName := GetPodFullName(&pod)
|
pod := &pods[ix]
|
||||||
|
podFullName := GetPodFullName(pod)
|
||||||
uuid := pod.Manifest.UUID
|
uuid := pod.Manifest.UUID
|
||||||
|
|
||||||
// Add all containers (including net) to the map.
|
// Add all containers (including net) to the map.
|
||||||
@ -647,7 +648,7 @@ func (kl *Kubelet) SyncPods(pods []Pod) error {
|
|||||||
|
|
||||||
// Run the sync in an async manifest worker.
|
// Run the sync in an async manifest worker.
|
||||||
kl.podWorkers.Run(podFullName, func() {
|
kl.podWorkers.Run(podFullName, func() {
|
||||||
err := kl.syncPod(&pod, dockerContainers)
|
err := kl.syncPod(pod, dockerContainers)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Error syncing pod: %v skipping.", err)
|
glog.Errorf("Error syncing pod: %v skipping.", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user