You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by "zhuqi-lucas (via GitHub)" <gi...@apache.org> on 2023/06/14 10:22:50 UTC

[GitHub] [yunikorn-k8shim] zhuqi-lucas commented on a diff in pull request #613: [YUNIKORN-1575] [shim] Ability to specify guaranteedResources via namespace annotations

zhuqi-lucas commented on code in PR #613:
URL: https://github.com/apache/yunikorn-k8shim/pull/613#discussion_r1229374234


##########
pkg/common/utils/utils.go:
##########
@@ -142,6 +142,21 @@ func PodUnderCondition(pod *v1.Pod, condition *v1.PodCondition) bool {
 	return current != nil && current.Status == condition.Status && current.Reason == condition.Reason
 }
 
+// get namespace guaranteed resource from namespace annotation
+func GetNamespaceGuaranteedFromAnnotation(namespaceObj *v1.Namespace) *si.Resource {
+	// retrieve guaranteed resource info from annotations
+	namespaceGuaranteed := GetNameSpaceAnnotationValue(namespaceObj, constants.NamespaceGuaranteed)
+	var namespaceGuaranteedMap map[string]string
+	err := json.Unmarshal([]byte(namespaceGuaranteed), &namespaceGuaranteedMap)
+	if err != nil {
+		log.Logger().Warn("Unable to process namespace.guaranteed annotation",
+			zap.String("namespace", namespaceObj.Name),
+			zap.String("namespace.guaranteed val is", namespaceGuaranteed))

Review Comment:
   Addressed in latest PR, thanks @pbacsko .



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