zhuqi-lucas commented on code in PR #569:
URL: https://github.com/apache/yunikorn-core/pull/569#discussion_r1258236431
##########
pkg/scheduler/objects/queue.go:
##########
@@ -663,29 +663,61 @@ func (sq *Queue) AddApplication(app *Application) {
// YUNIKORN-199: update the quota from the namespace
// get the tag with the quota
quota := app.GetTag(common.AppTagNamespaceResourceQuota)
- if quota == "" {
+ // get the tag with the guaranteed resource
+ guaranteed := app.GetTag(common.AppTagNamespaceResourceGuaranteed)
+ if quota == "" && guaranteed == "" {
return
}
+
+ var quotaRes, guaranteedRes *resources.Resource
+ var quotaErr, guaranteedErr error
+
// need to set a quota: convert json string to resource
- res, err := resources.NewResourceFromString(quota)
- if err != nil {
- log.Log(log.SchedQueue).Warn("application resource quota
conversion failure",
- zap.String("json quota string", quota),
- zap.Error(err))
- return
+ if quota != "" {
+ quotaRes, quotaErr = resources.NewResourceFromString(quota)
+ if quotaErr != nil {
+ log.Log(log.SchedQueue).Warn("application resource
quota conversion failure",
+ zap.String("json quota string", quota),
+ zap.Error(quotaErr))
+ } else if !resources.StrictlyGreaterThanZero(quotaRes) {
+ log.Log(log.SchedQueue).Warn("application resource
quota has at least one 0 value: cannot set queue limit",
+ zap.Stringer("maxResource", quotaRes))
Review Comment:
Good suggestion, will address 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]