Skip to content

Commit

Permalink
Merge pull request #157 from shiftstack/bz-1886848
Browse files Browse the repository at this point in the history
Bug 1886848: Save status before patching machine annotations
  • Loading branch information
openshift-merge-robot committed Jan 22, 2021
2 parents e9a2d1f + 4f41902 commit 471cf3a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/cloud/openstack/machine/actuator.go
Expand Up @@ -576,6 +576,8 @@ func (oc *OpenstackClient) handleMachineError(machine *machinev1.Machine, err *a
}

func (oc *OpenstackClient) updateAnnotation(machine *machinev1.Machine, instanceID string, clusterInfraName string) error {
statusCopy := *machine.Status.DeepCopy()

if machine.ObjectMeta.Annotations == nil {
machine.ObjectMeta.Annotations = make(map[string]string)
}
Expand Down Expand Up @@ -624,6 +626,7 @@ func (oc *OpenstackClient) updateAnnotation(machine *machinev1.Machine, instance
}
}

machine.Status = statusCopy
return oc.updateInstanceStatus(machine)
}

Expand Down

0 comments on commit 471cf3a

Please sign in to comment.