Merge pull request #84253 from yutedz/kube-solve-check
Move CheckLimitsForResolvConf to Kubelet#syncLoop
This commit is contained in:
commit
b1ac4cda11
@ -1831,6 +1831,13 @@ func (kl *Kubelet) syncLoop(updates <-chan kubetypes.PodUpdate, handler SyncHand
|
||||
factor = 2
|
||||
)
|
||||
duration := base
|
||||
// Responsible for checking limits in resolv.conf
|
||||
// The limits do not have anything to do with individual pods
|
||||
// Since this is called in syncLoop, we don't need to call it anywhere else
|
||||
if kl.dnsConfigurer != nil && kl.dnsConfigurer.ResolverConfig != "" {
|
||||
kl.dnsConfigurer.CheckLimitsForResolvConf()
|
||||
}
|
||||
|
||||
for {
|
||||
if err := kl.runtimeState.runtimeErrors(); err != nil {
|
||||
klog.Errorf("skipping pod synchronization - %v", err)
|
||||
@ -2037,11 +2044,6 @@ func (kl *Kubelet) handleMirrorPod(mirrorPod *v1.Pod, start time.Time) {
|
||||
func (kl *Kubelet) HandlePodAdditions(pods []*v1.Pod) {
|
||||
start := kl.clock.Now()
|
||||
sort.Sort(sliceutils.PodsByCreationTime(pods))
|
||||
// Responsible for checking limits in resolv.conf
|
||||
// The limits do not have anything to do with individual pods
|
||||
if kl.dnsConfigurer != nil && kl.dnsConfigurer.ResolverConfig != "" {
|
||||
kl.dnsConfigurer.CheckLimitsForResolvConf()
|
||||
}
|
||||
for _, pod := range pods {
|
||||
existingPods := kl.podManager.GetPods()
|
||||
// Always add the pod to the pod manager. Kubelet relies on the pod
|
||||
@ -2079,10 +2081,6 @@ func (kl *Kubelet) HandlePodAdditions(pods []*v1.Pod) {
|
||||
// being updated from a config source.
|
||||
func (kl *Kubelet) HandlePodUpdates(pods []*v1.Pod) {
|
||||
start := kl.clock.Now()
|
||||
// Responsible for checking limits in resolv.conf
|
||||
if kl.dnsConfigurer != nil && kl.dnsConfigurer.ResolverConfig != "" {
|
||||
kl.dnsConfigurer.CheckLimitsForResolvConf()
|
||||
}
|
||||
for _, pod := range pods {
|
||||
kl.podManager.UpdatePod(pod)
|
||||
if kubetypes.IsMirrorPod(pod) {
|
||||
|
Loading…
Reference in New Issue
Block a user