Skip to content

Commit dc8dc31

Browse files
committed
fix error treatment and remove annotations from proto
1 parent 09817b3 commit dc8dc31

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

pkg/kubelet/kuberuntime/kuberuntime_container.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,12 @@ func (m *kubeGenericRuntimeManager) updatePodSandboxResources(sandboxID string,
423423
if err != nil {
424424
stat, _ := grpcstatus.FromError(err)
425425
if stat.Code() == codes.Unimplemented {
426-
klog.ErrorS(err, "updatePodSandboxResources failed: method unimplemented on runtime service", "sandboxID", sandboxID)
426+
klog.InfoS("updatePodSandboxResources failed: method unimplemented on runtime service", "sandboxID", sandboxID)
427427
return nil
428428
}
429+
klog.ErrorS(err, "updatePodSandboxResources failed", "sandboxID", sandboxID)
429430
}
430-
return err
431+
return nil
431432
}
432433

433434
// makeDevices generates container devices for kubelet runtime v1.

pkg/kubelet/kuberuntime/kuberuntime_manager.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ func (m *kubeGenericRuntimeManager) doPodResizeAction(pod *v1.Pod, podContainerC
747747
// partially actuated.
748748
defer m.runtimeHelper.SetPodWatchCondition(pod.UID, "doPodResizeAction", func(*kubecontainer.PodStatus) bool { return true })
749749

750+
anyResizeDone := false
750751
if len(podContainerChanges.ContainersToUpdate[v1.ResourceMemory]) > 0 || podContainerChanges.UpdatePodResources {
751752
currentPodMemoryConfig, err := pcm.GetPodCgroupConfig(pod, v1.ResourceMemory)
752753
if err != nil {
@@ -775,9 +776,7 @@ func (m *kubeGenericRuntimeManager) doPodResizeAction(pod *v1.Pod, podContainerC
775776
result.Fail(errResize)
776777
return
777778
}
778-
if errUpdate := m.updatePodSandboxResources(podContainerChanges.SandboxID, pod); errUpdate != nil {
779-
klog.ErrorS(err, "updatePodSandboxResources failed", "pod", pod.Name)
780-
}
779+
anyResizeDone = true
781780
}
782781
if len(podContainerChanges.ContainersToUpdate[v1.ResourceCPU]) > 0 || podContainerChanges.UpdatePodResources {
783782
if podResources.CPUShares == nil {
@@ -804,8 +803,12 @@ func (m *kubeGenericRuntimeManager) doPodResizeAction(pod *v1.Pod, podContainerC
804803
result.Fail(errResize)
805804
return
806805
}
806+
anyResizeDone = true
807+
}
808+
809+
if anyResizeDone {
807810
if errUpdate := m.updatePodSandboxResources(podContainerChanges.SandboxID, pod); errUpdate != nil {
808-
klog.ErrorS(err, "updatePodSandboxResources failed", "pod", pod.Name)
811+
klog.ErrorS(errUpdate, "updatePodSandboxResources failed", "pod", pod.Name)
809812
}
810813
}
811814
}

0 commit comments

Comments
 (0)