You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by "craigcondit (via GitHub)" <gi...@apache.org> on 2023/02/11 15:16:34 UTC

[GitHub] [yunikorn-k8shim] craigcondit commented on a diff in pull request #520: [YUNIKORN-1526] support K8s pod overhead

craigcondit commented on code in PR #520:
URL: https://github.com/apache/yunikorn-k8shim/pull/520#discussion_r1103643797


##########
pkg/common/resource.go:
##########
@@ -79,6 +79,22 @@ func GetPodResource(pod *v1.Pod) (resource *si.Resource) {
 		checkInitContainerRequest(pod, podResource)
 	}
 
+	// K8s pod EnableOverHead from:
+	// alpha: v1.16
+	// beta: v1.18
+	// Enables PodOverhead, for accounting pod overheads which are specific to a given RuntimeClass
+
+	// If Overhead is being utilized, add to the total requests for the pod
+	if pod.Spec.Overhead != nil {
+		podOverHeadResource := getResource(pod.Spec.Overhead)
+		podResource = Add(podResource, podOverHeadResource)
+		// Logging the overall pod size and pod overhead
+		log.Logger().Debug("Pod overhead specified, overall pod size adjusted",

Review Comment:
   Can we use zap.Stringer(...) instead of zap.String(...) here? Then .String() won't be called unless debug logging is enabled. Also, everywhere else we log using simple strings for zap keys (i.e. "overallSize" vs. "Pod overall size", "overheadSize" vs. "Pod overhead size". This helps consistency and makes it easier for tooling to parse.



-- 
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