Skip to content

Commit 195b829

Browse files
authored
Add a nil check before trying to adding mc annotation (#966)
1 parent 6dff075 commit 195b829

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/controller/deployment.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,9 @@ func (dc *controller) setMachinePriorityAnnotationAndUpdateTriggeredForDeletion(
636636
continue
637637
}
638638
mcAdjust := mc.DeepCopy()
639+
if mcAdjust.Annotations == nil {
640+
mcAdjust.Annotations = make(map[string]string)
641+
}
639642
mcAdjust.Annotations[machineutils.MachinePriority] = "1"
640643
_, err = dc.controlMachineClient.Machines(mcAdjust.Namespace).Update(ctx, mcAdjust, metav1.UpdateOptions{})
641644
if err != nil {

0 commit comments

Comments
 (0)