mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Fix FakeStatusManager SetPodAllocation
This commit is contained in:
parent
7166169c82
commit
40595bd94b
@ -80,10 +80,7 @@ func (m *fakeManager) UpdatePodFromAllocation(pod *v1.Pod) (*v1.Pod, bool) {
|
|||||||
func (m *fakeManager) SetPodAllocation(pod *v1.Pod) error {
|
func (m *fakeManager) SetPodAllocation(pod *v1.Pod) error {
|
||||||
klog.InfoS("SetPodAllocation()")
|
klog.InfoS("SetPodAllocation()")
|
||||||
for _, container := range pod.Spec.Containers {
|
for _, container := range pod.Spec.Containers {
|
||||||
var alloc v1.ResourceRequirements
|
alloc := *container.Resources.DeepCopy()
|
||||||
if container.Resources.Requests != nil {
|
|
||||||
alloc = *container.Resources.DeepCopy()
|
|
||||||
}
|
|
||||||
m.state.SetContainerResourceAllocation(string(pod.UID), container.Name, alloc)
|
m.state.SetContainerResourceAllocation(string(pod.UID), container.Name, alloc)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user