wilfred-s commented on code in PR #933:
URL: https://github.com/apache/yunikorn-core/pull/933#discussion_r1708451520


##########
pkg/common/resources/resources.go:
##########
@@ -364,6 +364,21 @@ func (r *Resource) SubOnlyExisting(delta *Resource) {
        }
 }
 
+// AddOnlyExisting adds delta to defined resource.
+// Ignore any type not defined in the base resource (ie receiver).
+func (r *Resource) AddOnlyExisting(delta *Resource) *Resource {

Review Comment:
   done, however not using the `SubOnlyExisting()` semantics. I like that 
semantic but it is not a fit in this case. Using that semantic we would be 
introducing a guaranteed clone of the `alloc` variable in the queue code. The 
allocated resource comes directly from the allocation that is created based on 
the ask so it must not be mutated. The only way to do that is clone it in the 
queue code before calling.



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