mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 11:47:36 +08:00
commit
85409d5dce
@ -1931,25 +1931,9 @@ func (s *ServiceAction) GetMultiServicePods(serviceIDs []string) (*K8sPodInfos,
|
||||
podInfo.PodIP = v.PodIp
|
||||
podInfo.PodStatus = v.PodStatus
|
||||
podInfo.ServiceID = serviceID
|
||||
containerInfos := make(map[string]map[string]string, 10)
|
||||
for _, container := range v.Containers {
|
||||
containerInfos[container.ContainerName] = map[string]string{
|
||||
"memory_limit": fmt.Sprintf("%d", container.MemoryLimit),
|
||||
"memory_usage": "0",
|
||||
}
|
||||
}
|
||||
podInfo.Container = containerInfos
|
||||
podNames = append(podNames, v.PodName)
|
||||
podsInfoList = append(podsInfoList, &podInfo)
|
||||
}
|
||||
containerMemInfo, _ := s.GetPodContainerMemory(podNames)
|
||||
for _, c := range podsInfoList {
|
||||
for k := range c.Container {
|
||||
if info, exist := containerMemInfo[c.PodName][k]; exist {
|
||||
c.Container[k]["memory_usage"] = info
|
||||
}
|
||||
}
|
||||
}
|
||||
return podsInfoList
|
||||
}
|
||||
var re K8sPodInfos
|
||||
|
Loading…
Reference in New Issue
Block a user