Skip to content

Commit 3301efa

Browse files
committed
kubelet: warn instead of error for unsupported options on Windows
Make validateKubeletOSConfiguration() show warnings instead of returning errors on Windows for the fields "CgroupsPerQOS" and "EnforceNodeAllocatable".
1 parent 026ce57 commit 3301efa

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

pkg/kubelet/apis/config/validation/validation_windows.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,22 @@ limitations under the License.
2020
package validation
2121

2222
import (
23-
"fmt"
23+
"k8s.io/klog/v2"
2424

25-
utilerrors "k8s.io/apimachinery/pkg/util/errors"
2625
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
2726
)
2827

2928
// validateKubeletOSConfiguration validates os specific kubelet configuration and returns an error if it is invalid.
3029
func validateKubeletOSConfiguration(kc *kubeletconfig.KubeletConfiguration) error {
31-
message := "invalid configuration: %v (%v) %v is not supported on Windows"
32-
allErrors := []error{}
30+
message := "ignored configuration option: %v (%v) %v is not supported on Windows"
3331

3432
if kc.CgroupsPerQOS {
35-
allErrors = append(allErrors, fmt.Errorf(message, "CgroupsPerQOS", "--cgroups-per-qos", kc.CgroupsPerQOS))
33+
klog.Warningf(message, "CgroupsPerQOS", "--cgroups-per-qos", kc.CgroupsPerQOS)
3634
}
3735

3836
if len(kc.EnforceNodeAllocatable) > 0 {
39-
allErrors = append(allErrors, fmt.Errorf(message, "EnforceNodeAllocatable", "--enforce-node-allocatable", kc.EnforceNodeAllocatable))
37+
klog.Warningf(message, "EnforceNodeAllocatable", "--enforce-node-allocatable", kc.EnforceNodeAllocatable)
4038
}
4139

42-
return utilerrors.NewAggregate(allErrors)
40+
return nil
4341
}

0 commit comments

Comments
 (0)