Unverified Commit 7b9f8a30 authored by Darren Shepherd's avatar Darren Shepherd Committed by GitHub

Merge pull request #348 from erikwilson/k3s-fix-enforce-node-allocatable-validation

Fix kubelet --enforce-node-allocatable validation
parents eed6fd4c 765cdc17
......@@ -18,6 +18,7 @@ package validation
import (
"fmt"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
utilvalidation "k8s.io/apimachinery/pkg/util/validation"
utilfeature "k8s.io/apiserver/pkg/util/feature"
......@@ -38,7 +39,8 @@ func ValidateKubeletConfiguration(kc *kubeletconfig.KubeletConfiguration) error
if kc.NodeLeaseDurationSeconds <= 0 {
allErrors = append(allErrors, fmt.Errorf("invalid configuration: NodeLeaseDurationSeconds must be greater than 0"))
}
if !kc.CgroupsPerQOS && len(kc.EnforceNodeAllocatable) > 0 {
if !kc.CgroupsPerQOS && len(kc.EnforceNodeAllocatable) > 0 &&
!(len(kc.EnforceNodeAllocatable) == 1 && kc.EnforceNodeAllocatable[0] == kubetypes.NodeAllocatableNoneKey) {
allErrors = append(allErrors, fmt.Errorf("invalid configuration: EnforceNodeAllocatable (--enforce-node-allocatable) is not supported unless CgroupsPerQOS (--cgroups-per-qos) feature is turned on"))
}
if kc.SystemCgroups != "" && kc.CgroupRoot == "" {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment