File tree 1 file changed +4
-2
lines changed
staging/src/k8s.io/component-helpers/resource
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ limitations under the License.
17
17
package resource
18
18
19
19
import (
20
+ "strings"
21
+
20
22
v1 "k8s.io/api/core/v1"
21
23
"k8s.io/apimachinery/pkg/util/sets"
22
24
)
@@ -56,14 +58,14 @@ type PodResourcesOptions struct {
56
58
var supportedPodLevelResources = sets .New (v1 .ResourceCPU , v1 .ResourceMemory )
57
59
58
60
func SupportedPodLevelResources () sets.Set [v1.ResourceName ] {
59
- return supportedPodLevelResources
61
+ return supportedPodLevelResources . Clone (). Insert ( v1 . ResourceHugePagesPrefix )
60
62
}
61
63
62
64
// IsSupportedPodLevelResources checks if a given resource is supported by pod-level
63
65
// resource management through the PodLevelResources feature. Returns true if
64
66
// the resource is supported.
65
67
func IsSupportedPodLevelResource (name v1.ResourceName ) bool {
66
- return supportedPodLevelResources .Has (name )
68
+ return supportedPodLevelResources .Has (name ) || strings . HasPrefix ( string ( name ), v1 . ResourceHugePagesPrefix )
67
69
}
68
70
69
71
// IsPodLevelResourcesSet check if PodLevelResources pod-level resources are set.
You can’t perform that action at this time.
0 commit comments