mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
fix error treatment and remove annotations from proto
This commit is contained in:
parent
09817b320f
commit
dc8dc31442
@ -423,11 +423,12 @@ func (m *kubeGenericRuntimeManager) updatePodSandboxResources(sandboxID string,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
stat, _ := grpcstatus.FromError(err)
|
stat, _ := grpcstatus.FromError(err)
|
||||||
if stat.Code() == codes.Unimplemented {
|
if stat.Code() == codes.Unimplemented {
|
||||||
klog.ErrorS(err, "updatePodSandboxResources failed: method unimplemented on runtime service", "sandboxID", sandboxID)
|
klog.InfoS("updatePodSandboxResources failed: method unimplemented on runtime service", "sandboxID", sandboxID)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
klog.ErrorS(err, "updatePodSandboxResources failed", "sandboxID", sandboxID)
|
||||||
}
|
}
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// makeDevices generates container devices for kubelet runtime v1.
|
// makeDevices generates container devices for kubelet runtime v1.
|
||||||
|
@ -747,6 +747,7 @@ func (m *kubeGenericRuntimeManager) doPodResizeAction(pod *v1.Pod, podContainerC
|
|||||||
// partially actuated.
|
// partially actuated.
|
||||||
defer m.runtimeHelper.SetPodWatchCondition(pod.UID, "doPodResizeAction", func(*kubecontainer.PodStatus) bool { return true })
|
defer m.runtimeHelper.SetPodWatchCondition(pod.UID, "doPodResizeAction", func(*kubecontainer.PodStatus) bool { return true })
|
||||||
|
|
||||||
|
anyResizeDone := false
|
||||||
if len(podContainerChanges.ContainersToUpdate[v1.ResourceMemory]) > 0 || podContainerChanges.UpdatePodResources {
|
if len(podContainerChanges.ContainersToUpdate[v1.ResourceMemory]) > 0 || podContainerChanges.UpdatePodResources {
|
||||||
currentPodMemoryConfig, err := pcm.GetPodCgroupConfig(pod, v1.ResourceMemory)
|
currentPodMemoryConfig, err := pcm.GetPodCgroupConfig(pod, v1.ResourceMemory)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -775,9 +776,7 @@ func (m *kubeGenericRuntimeManager) doPodResizeAction(pod *v1.Pod, podContainerC
|
|||||||
result.Fail(errResize)
|
result.Fail(errResize)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if errUpdate := m.updatePodSandboxResources(podContainerChanges.SandboxID, pod); errUpdate != nil {
|
anyResizeDone = true
|
||||||
klog.ErrorS(err, "updatePodSandboxResources failed", "pod", pod.Name)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if len(podContainerChanges.ContainersToUpdate[v1.ResourceCPU]) > 0 || podContainerChanges.UpdatePodResources {
|
if len(podContainerChanges.ContainersToUpdate[v1.ResourceCPU]) > 0 || podContainerChanges.UpdatePodResources {
|
||||||
if podResources.CPUShares == nil {
|
if podResources.CPUShares == nil {
|
||||||
@ -804,8 +803,12 @@ func (m *kubeGenericRuntimeManager) doPodResizeAction(pod *v1.Pod, podContainerC
|
|||||||
result.Fail(errResize)
|
result.Fail(errResize)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
anyResizeDone = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if anyResizeDone {
|
||||||
if errUpdate := m.updatePodSandboxResources(podContainerChanges.SandboxID, pod); errUpdate != nil {
|
if errUpdate := m.updatePodSandboxResources(podContainerChanges.SandboxID, pod); errUpdate != nil {
|
||||||
klog.ErrorS(err, "updatePodSandboxResources failed", "pod", pod.Name)
|
klog.ErrorS(errUpdate, "updatePodSandboxResources failed", "pod", pod.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user