0yukali0 commented on a change in pull request #281:
URL:
https://github.com/apache/incubator-yunikorn-k8shim/pull/281#discussion_r676649645
##########
File path: pkg/common/resource.go
##########
@@ -72,9 +72,31 @@ func GetPodResource(pod *v1.Pod) (resource *si.Resource) {
containerResource := getResource(resourceList)
podResource = Add(podResource, containerResource)
}
+
+ // vcore, mem compare between initcontainer and containers and
replace(choose bigger one)
+ if pod.Spec.InitContainers != nil {
+ IsNeedMoreResourceAndSet(pod, podResource)
+ }
+
return podResource
}
+func IsNeedMoreResourceAndSet(pod *v1.Pod, containersResources *si.Resource) {
+ for _, c := range pod.Spec.InitContainers {
+ resourceList := c.Resources.Requests
+ initCResource := getResource(resourceList)
+ for resouceName, v1 := range initCResource.Resources {
+ v2, exist := containersResources.Resources[resouceName]
Review comment:
Got it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]