Skip to content

Commit

Permalink
Merge pull request #424 from Fedosin/annotation_terminated
Browse files Browse the repository at this point in the history
Bug 2007802: do not requeue if the machine has been updated
  • Loading branch information
openshift-merge-robot authored Oct 13, 2021
2 parents 9eb5cae + c971ae6 commit f453fb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/actuators/machine/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (r *Reconciler) update() error {

existingLen := len(existingInstances)
if existingLen == 0 {
if r.machine.Spec.ProviderID != nil && *r.machine.Spec.ProviderID != "" && len(r.machine.Status.Addresses) == 0 {
if r.machine.Spec.ProviderID != nil && *r.machine.Spec.ProviderID != "" && len(r.machine.Status.Addresses) == 0 && (r.machine.Status.LastUpdated == nil || r.machine.Status.LastUpdated.Add(requeueAfterSeconds*time.Second).After(time.Now())) {
klog.Infof("%s: Possible eventual-consistency discrepancy; returning an error to requeue", r.machine.Name)
return &machinecontroller.RequeueAfterError{RequeueAfter: requeueAfterSeconds * time.Second}
}
Expand Down Expand Up @@ -257,7 +257,7 @@ func (r *Reconciler) exists() (bool, error) {
}

if len(existingInstances) == 0 {
if r.machine.Spec.ProviderID != nil && *r.machine.Spec.ProviderID != "" && len(r.machine.Status.Addresses) == 0 {
if r.machine.Spec.ProviderID != nil && *r.machine.Spec.ProviderID != "" && len(r.machine.Status.Addresses) == 0 && (r.machine.Status.LastUpdated == nil || r.machine.Status.LastUpdated.Add(requeueAfterSeconds*time.Second).After(time.Now())) {
klog.Infof("%s: Possible eventual-consistency discrepancy; returning an error to requeue", r.machine.Name)
return false, &machinecontroller.RequeueAfterError{RequeueAfter: requeueAfterSeconds * time.Second}
}
Expand Down

0 comments on commit f453fb3

Please sign in to comment.