You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2021/07/26 14:20:14 UTC

[GitHub] [incubator-yunikorn-k8shim] 0yukali0 commented on a change in pull request #281: [YUNIKONR-706] Fix the resource calculation when the pod has init-containers

0yukali0 commented on a change in pull request #281:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/281#discussion_r676649383



##########
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) {

Review comment:
       Ok




-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org