From e6e9fce2c68d639b621492eb60fa407e00cd78a6 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Wed, 22 Apr 2026 16:28:25 +0300 Subject: [PATCH] scheduler/dra: remove redundant nil check currentClaimStatus.Resources is initialized as an empty map when the struct is constructed, so the nil check is a dead code. --- .../dynamicresources/nodeallocatabledynamicresources.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/scheduler/framework/plugins/dynamicresources/nodeallocatabledynamicresources.go b/pkg/scheduler/framework/plugins/dynamicresources/nodeallocatabledynamicresources.go index d509445d7f4..02e754a6b61 100644 --- a/pkg/scheduler/framework/plugins/dynamicresources/nodeallocatabledynamicresources.go +++ b/pkg/scheduler/framework/plugins/dynamicresources/nodeallocatabledynamicresources.go @@ -171,9 +171,6 @@ func (pl *DynamicResources) buildNodeAllocatableDRAInfo(pod *v1.Pod, nodeAllocat quantity = resourceMap.AllocationMultiplier.DeepCopy() } - if currentClaimStatus.Resources == nil { - currentClaimStatus.Resources = make(map[v1.ResourceName]resource.Quantity) - } curQuantity, ok := currentClaimStatus.Resources[resourceName] if !ok { currentClaimStatus.Resources[resourceName] = quantity