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