Skip to content

Commit

Permalink
fix kubeletconfig validation
Browse files Browse the repository at this point in the history
  • Loading branch information
richardchen-db committed Aug 5, 2022
1 parent d2c789d commit 15e0567
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exp/api/v1beta1/azuremanagedmachinepool_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.*":
Expand Down

0 comments on commit 15e0567

Please sign in to comment.