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/04/08 11:40:54 UTC

[GitHub] [incubator-yunikorn-core] kingamarton commented on a change in pull request #264: [YUNIKORN-631] undefined max resource handling

kingamarton commented on a change in pull request #264:
URL: https://github.com/apache/incubator-yunikorn-core/pull/264#discussion_r609603436



##########
File path: pkg/common/resources/resources.go
##########
@@ -395,12 +395,26 @@ func subNonNegative(left, right *Resource) (*Resource, string) {
 	}
 	return out, message
 }
-
-// Check if smaller fitin larger, negative values will be treated as 0
-// A nil resource is treated as an empty resource (zero)
+// Check if smaller fits in larger, negative values will be treated as 0
+// Types not defined in the larger resource are considered 0 values for Quantity
+// A nil resource is treated as an empty resource (all types are 0)
 func FitIn(larger, smaller *Resource) bool {

Review comment:
       I think we should rename the two FitIn functions: `func FitIn(larger, smaller *Resource) bool` and` func (r *Resource) FitIn(smaller *Resource) bool` to a name what reflects the difference between them. Having the same name is easy to mix them, also while reading the code is not obvious what will happen with the undefined resources.




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

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