File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -421,7 +421,12 @@ func (m *MachinePoolScope) applyAzureMachinePoolMachines(ctx context.Context) er
421421 if machine != nil && machine .Annotations != nil {
422422 if _ , hasDeleteAnnotation := machine .Annotations [clusterv1 .DeleteMachineAnnotation ]; hasDeleteAnnotation {
423423 log .V (4 ).Info ("propagating DeleteMachineAnnotation" , "machine" , ampm .Spec .ProviderID )
424- existingMachinesByProviderID [ampm .Spec .ProviderID ].Annotations [clusterv1 .DeleteMachineAnnotation ] = machine .Annotations [clusterv1 .DeleteMachineAnnotation ]
424+ if ampm .Annotations == nil {
425+ ampm .Annotations = make (map [string ]string )
426+ }
427+ ampm .Annotations [clusterv1 .DeleteMachineAnnotation ] = machine .Annotations [clusterv1 .DeleteMachineAnnotation ]
428+ // reassign
429+ existingMachinesByProviderID [ampm .Spec .ProviderID ] = ampm
425430 }
426431 }
427432 }
You can’t perform that action at this time.
0 commit comments