mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Elimenate extra CRI call
This commit is contained in:
parent
e1d923a7cb
commit
282973d87d
@ -176,11 +176,16 @@ func (m *manager) AddContainer(p *v1.Pod, c *v1.Container, containerID string) e
|
|||||||
cpus := m.state.GetCPUSetOrDefault(containerID)
|
cpus := m.state.GetCPUSetOrDefault(containerID)
|
||||||
m.Unlock()
|
m.Unlock()
|
||||||
|
|
||||||
|
if !cpus.IsEmpty() {
|
||||||
err = m.updateContainerCPUSet(containerID, cpus)
|
err = m.updateContainerCPUSet(containerID, cpus)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("[cpumanager] AddContainer error: %v", err)
|
glog.Errorf("[cpumanager] AddContainer error: %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
glog.V(5).Infof("[cpumanager] update container resources is skipped due to cpu set is empty")
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ func TestCPUManagerAdd(t *testing.T) {
|
|||||||
description: "cpu manager add - container update error",
|
description: "cpu manager add - container update error",
|
||||||
regErr: nil,
|
regErr: nil,
|
||||||
updateErr: fmt.Errorf("fake update error"),
|
updateErr: fmt.Errorf("fake update error"),
|
||||||
expErr: fmt.Errorf("fake update error"),
|
expErr: nil,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user