From 15e056782a6340f7957ce4d68724b15a83e36eec Mon Sep 17 00:00:00 2001 From: Richard Chen Date: Fri, 5 Aug 2022 15:00:31 -0700 Subject: [PATCH] fix kubeletconfig validation --- exp/api/v1beta1/azuremanagedmachinepool_webhook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exp/api/v1beta1/azuremanagedmachinepool_webhook.go b/exp/api/v1beta1/azuremanagedmachinepool_webhook.go index c050350a85d..82b4de2bdcf 100644 --- a/exp/api/v1beta1/azuremanagedmachinepool_webhook.go +++ b/exp/api/v1beta1/azuremanagedmachinepool_webhook.go @@ -376,7 +376,7 @@ func (m *AzureManagedMachinePool) validateMaxPods() *field.Error { func (m *AzureManagedMachinePool) validateKubeletConfig() *field.Error { // AllowedUnsafeSysctls should be one of "kernel.shm*", "kernel.msg*", "kernel.sem", "fs.mqueue.*", "net.*". - if m.Spec.KubeletConfig != nil && len(*m.Spec.KubeletConfig.AllowedUnsafeSysctls) > 0 { + if m.Spec.KubeletConfig != nil && m.Spec.KubeletConfig.AllowedUnsafeSysctls != nil && len(*m.Spec.KubeletConfig.AllowedUnsafeSysctls) > 0 { for _, v := range *m.Spec.KubeletConfig.AllowedUnsafeSysctls { switch v { case "kernel.shm*", "kernel.msg*", "kernel.sem", "fs.mqueue.*", "net.*":