From 11fde1278e853e289a9faefc341728f9bd9e1448 Mon Sep 17 00:00:00 2001 From: Daniel Juravski Date: Tue, 7 Feb 2023 13:02:20 +0200 Subject: [PATCH] Skip 'hugepages' resources on ceiling --- pkg/utils/resources/resources.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/utils/resources/resources.go b/pkg/utils/resources/resources.go index 1fdc860b54..85e4b44ada 100644 --- a/pkg/utils/resources/resources.go +++ b/pkg/utils/resources/resources.go @@ -51,6 +51,9 @@ func Merge(resources ...v1.ResourceList) v1.ResourceList { result := make(v1.ResourceList, len(resources[0])) for _, resourceList := range resources { for resourceName, quantity := range resourceList { + if resourceName == "hugepages-2Mi" || resourceName == "hugepages-1Gi" { + continue + } current := result[resourceName] current.Add(quantity) result[resourceName] = current @@ -93,6 +96,9 @@ func MaxResources(resources ...v1.ResourceList) v1.ResourceList { resourceList := v1.ResourceList{} for _, resource := range resources { for resourceName, quantity := range resource { + if resourceName == "hugepages-2Mi" || resourceName == "hugepages-1Gi" { + continue + } if value, ok := resourceList[resourceName]; !ok || quantity.Cmp(value) > 0 { resourceList[resourceName] = quantity }