mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-03 12:18:09 +08:00
Merge branch 'master' of https://github.com/goodrain/rainbond
This commit is contained in:
commit
3b03407139
@ -938,7 +938,17 @@ func (a *appRuntimeStore) GetTenantResource(tenantID string) *v1.TenantResource
|
||||
}
|
||||
|
||||
calculateResourcesfunc := func(pod *corev1.Pod, res map[string]int64) {
|
||||
runningC := make(map[string]struct{})
|
||||
cstatus := append(pod.Status.ContainerStatuses, pod.Status.InitContainerStatuses...)
|
||||
for _, c := range cstatus {
|
||||
if c.State.Running != nil {
|
||||
runningC[c.Name] = struct{}{}
|
||||
}
|
||||
}
|
||||
for _, container := range pod.Spec.Containers {
|
||||
if _, ok := runningC[container.Name]; !ok {
|
||||
continue
|
||||
}
|
||||
cpulimit := container.Resources.Limits.Cpu()
|
||||
memorylimit := container.Resources.Limits.Memory()
|
||||
cpurequest := container.Resources.Requests.Cpu()
|
||||
|
Loading…
Reference in New Issue
Block a user