mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 03:03:59 +00:00
Fix linter errors
This commit is contained in:
parent
bf8354d460
commit
1d822f1dc8
@ -672,7 +672,7 @@ func (m *kubeGenericRuntimeManager) doPodResizeAction(pod *v1.Pod, podStatus *ku
|
|||||||
podResources := cm.ResourceConfigForPod(pod, m.cpuCFSQuota, uint64((m.cpuCFSQuotaPeriod.Duration)/time.Microsecond), false)
|
podResources := cm.ResourceConfigForPod(pod, m.cpuCFSQuota, uint64((m.cpuCFSQuotaPeriod.Duration)/time.Microsecond), false)
|
||||||
if podResources == nil {
|
if podResources == nil {
|
||||||
klog.ErrorS(nil, "Unable to get resource configuration", "pod", pod.Name)
|
klog.ErrorS(nil, "Unable to get resource configuration", "pod", pod.Name)
|
||||||
result.Fail(fmt.Errorf("Unable to get resource configuration processing resize for pod %s", pod.Name))
|
result.Fail(fmt.Errorf("unable to get resource configuration processing resize for pod %s", pod.Name))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
setPodCgroupConfig := func(rName v1.ResourceName, setLimitValue bool) error {
|
setPodCgroupConfig := func(rName v1.ResourceName, setLimitValue bool) error {
|
||||||
@ -751,7 +751,7 @@ func (m *kubeGenericRuntimeManager) doPodResizeAction(pod *v1.Pod, podStatus *ku
|
|||||||
}
|
}
|
||||||
if currentPodMemoryUsage >= uint64(*podResources.Memory) {
|
if currentPodMemoryUsage >= uint64(*podResources.Memory) {
|
||||||
klog.ErrorS(nil, "Aborting attempt to set pod memory limit less than current memory usage", "pod", pod.Name)
|
klog.ErrorS(nil, "Aborting attempt to set pod memory limit less than current memory usage", "pod", pod.Name)
|
||||||
result.Fail(fmt.Errorf("Aborting attempt to set pod memory limit less than current memory usage for pod %s", pod.Name))
|
result.Fail(fmt.Errorf("aborting attempt to set pod memory limit less than current memory usage for pod %s", pod.Name))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if errResize := resizeContainers(v1.ResourceMemory, int64(*currentPodMemoryConfig.Memory), *podResources.Memory, 0, 0); errResize != nil {
|
if errResize := resizeContainers(v1.ResourceMemory, int64(*currentPodMemoryConfig.Memory), *podResources.Memory, 0, 0); errResize != nil {
|
||||||
|
@ -2685,7 +2685,7 @@ func TestUpdatePodContainerResources(t *testing.T) {
|
|||||||
}
|
}
|
||||||
fakeRuntime.Called = []string{}
|
fakeRuntime.Called = []string{}
|
||||||
err := m.updatePodContainerResources(pod, tc.resourceName, containersToUpdate)
|
err := m.updatePodContainerResources(pod, tc.resourceName, containersToUpdate)
|
||||||
assert.NoError(t, err, dsc)
|
require.NoError(t, err, dsc)
|
||||||
|
|
||||||
if tc.invokeUpdateResources {
|
if tc.invokeUpdateResources {
|
||||||
assert.Contains(t, fakeRuntime.Called, "UpdateContainerResources", dsc)
|
assert.Contains(t, fakeRuntime.Called, "UpdateContainerResources", dsc)
|
||||||
|
Loading…
Reference in New Issue
Block a user