[YUNIKORN-2574] totalPartitionResource should not be mutated with AddTo/SubFrom (#853)
Closes: #853
Signed-off-by: Craig Condit <ccondit@apache.org>
diff --git a/pkg/scheduler/partition.go b/pkg/scheduler/partition.go
index 992efad..a72dc75 100644
--- a/pkg/scheduler/partition.go
+++ b/pkg/scheduler/partition.go
@@ -1013,7 +1013,7 @@
pc.RLock()
defer pc.RUnlock()
- return pc.totalPartitionResource
+ return pc.totalPartitionResource.Clone()
}
func (pc *PartitionContext) GetAllocatedResource() *resources.Resource {