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 }