pbacsko commented on code in PR #613:
URL: https://github.com/apache/yunikorn-k8shim/pull/613#discussion_r1230670244


##########
pkg/cache/context.go:
##########
@@ -702,10 +702,19 @@ func (ctx *Context) updateApplicationTags(request 
*interfaces.AddApplicationRequ
        // add resource quota info as an app tag
        resourceQuota := utils.GetNamespaceQuotaFromAnnotation(namespaceObj)
        if resourceQuota != nil && !common.IsZero(resourceQuota) {
-               if quotaStr, err := json.Marshal(resourceQuota); err == nil {
-                       
request.Metadata.Tags[siCommon.AppTagNamespaceResourceQuota] = string(quotaStr)
+               if quota, err := json.Marshal(resourceQuota); err == nil {
+                       
request.Metadata.Tags[siCommon.AppTagNamespaceResourceQuota] = string(quota)
                }
        }
+
+       // add guaranteed resource info as an app tag
+       guaranteedResource := 
utils.GetNamespaceGuaranteedFromAnnotation(namespaceObj)
+       if guaranteedResource != nil && !common.IsZero(guaranteedResource) {
+               if guaranteed, err := json.Marshal(guaranteedResource); err == 
nil {
+                       
request.Metadata.Tags[siCommon.AppTagNamespaceResourceGuaranteed] = 
string(guaranteed)
+               }
+       }

Review Comment:
   Please add test coverage to `TestAddApplicationsWithTags()`, there is a 
dummy lister and existing namespace object which you can re-use.



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

Reply via email to