mirror of https://github.com/k3s-io/k3s
Merge pull request #19784 from Random-Liu/cleanup-kubelet-syncpod
Auto commit by PR queue botpull/6/head
commit
2d061aa199
|
@ -441,7 +441,6 @@ func (dm *DockerManager) ConvertPodStatusToAPIPodStatus(pod *api.Pod, podStatus
|
|||
}
|
||||
|
||||
containerDone := sets.NewString()
|
||||
// NOTE(random-liu): The Pod IP is generated in kubelet.generatePodStatus(), we have no podStatus.IP now
|
||||
apiPodStatus.PodIP = podStatus.IP
|
||||
for _, containerStatus := range podStatus.ContainerStatuses {
|
||||
cName := containerStatus.Name
|
||||
|
|
|
@ -1688,17 +1688,8 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
|
|||
if podUsesHostNetwork(pod) {
|
||||
kl.recorder.Event(pod, api.EventTypeWarning, kubecontainer.HostNetworkNotSupported, "Bandwidth shaping is not currently supported on the host network")
|
||||
} else if kl.shaper != nil {
|
||||
status, found := kl.statusManager.GetPodStatus(pod.UID)
|
||||
if !found {
|
||||
statusPtr, err := kl.containerRuntime.GetAPIPodStatus(pod)
|
||||
if err != nil {
|
||||
glog.Errorf("Error getting pod for bandwidth shaping")
|
||||
return err
|
||||
}
|
||||
status = *statusPtr
|
||||
}
|
||||
if len(status.PodIP) > 0 {
|
||||
err = kl.shaper.ReconcileCIDR(fmt.Sprintf("%s/32", status.PodIP), egress, ingress)
|
||||
if len(apiPodStatus.PodIP) > 0 {
|
||||
err = kl.shaper.ReconcileCIDR(fmt.Sprintf("%s/32", apiPodStatus.PodIP), egress, ingress)
|
||||
}
|
||||
} else {
|
||||
kl.recorder.Event(pod, api.EventTypeWarning, kubecontainer.UndefinedShaper, "Pod requests bandwidth shaping, but the shaper is undefined")
|
||||
|
|
Loading…
Reference in New Issue