From 875071679242c80e46e4683074933f9312c2fbe8 Mon Sep 17 00:00:00 2001 From: Mayank Jha Date: Fri, 20 Jan 2023 14:36:26 -0500 Subject: [PATCH] Fixing panic on AzureMachinePool creation with auto-scale --- azure/scope/managedmachinepool.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure/scope/managedmachinepool.go b/azure/scope/managedmachinepool.go index a6a32e9b976..e43cfeb2d5c 100644 --- a/azure/scope/managedmachinepool.go +++ b/azure/scope/managedmachinepool.go @@ -310,6 +310,9 @@ func (s *ManagedMachinePoolScope) SetCAPIMachinePoolReplicas(replicas *int32) { // SetCAPIMachinePoolAnnotation sets the specified annotation on the associated MachinePool. func (s *ManagedMachinePoolScope) SetCAPIMachinePoolAnnotation(key, value string) { + if s.MachinePool.Annotations == nil { + s.MachinePool.Annotations = make(map[string]string) + } s.MachinePool.Annotations[key] = value }