mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Merge pull request #123137 from neolit123/1.30-update-kubelet-validation-fields
kubelet: warn instead of error for unsupported options on Windows
This commit is contained in:
commit
eb9b928c23
@ -20,24 +20,22 @@ limitations under the License.
|
||||
package validation
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
|
||||
)
|
||||
|
||||
// validateKubeletOSConfiguration validates os specific kubelet configuration and returns an error if it is invalid.
|
||||
func validateKubeletOSConfiguration(kc *kubeletconfig.KubeletConfiguration) error {
|
||||
message := "invalid configuration: %v (%v) %v is not supported on Windows"
|
||||
allErrors := []error{}
|
||||
message := "ignored configuration option: %v (%v) %v is not supported on Windows"
|
||||
|
||||
if kc.CgroupsPerQOS {
|
||||
allErrors = append(allErrors, fmt.Errorf(message, "CgroupsPerQOS", "--cgroups-per-qos", kc.CgroupsPerQOS))
|
||||
klog.Warningf(message, "CgroupsPerQOS", "--cgroups-per-qos", kc.CgroupsPerQOS)
|
||||
}
|
||||
|
||||
if len(kc.EnforceNodeAllocatable) > 0 {
|
||||
allErrors = append(allErrors, fmt.Errorf(message, "EnforceNodeAllocatable", "--enforce-node-allocatable", kc.EnforceNodeAllocatable))
|
||||
klog.Warningf(message, "EnforceNodeAllocatable", "--enforce-node-allocatable", kc.EnforceNodeAllocatable)
|
||||
}
|
||||
|
||||
return utilerrors.NewAggregate(allErrors)
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user