Skip to content

Commit

Permalink
Add a nil check before trying to adding mc annotation (#966) (#967)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronfern authored Feb 17, 2025
1 parent cb8e9da commit a525cbb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controller/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,9 @@ func (dc *controller) setMachinePriorityAnnotationAndUpdateTriggeredForDeletion(
continue
}
mcAdjust := mc.DeepCopy()
if mcAdjust.Annotations == nil {
mcAdjust.Annotations = make(map[string]string)
}
mcAdjust.Annotations[machineutils.MachinePriority] = "1"
_, err = dc.controlMachineClient.Machines(mcAdjust.Namespace).Update(ctx, mcAdjust, metav1.UpdateOptions{})
if err != nil {
Expand Down

0 comments on commit a525cbb

Please sign in to comment.