Skip to content

Commit

Permalink
Merge pull request #280 from mgugino-upstream-stage/check-empty-quote…
Browse files Browse the repository at this point in the history
…-providerspec

Bug 1781339: Ensure Spec.ProviderID is not empty string
  • Loading branch information
openshift-merge-robot authored Dec 11, 2019
2 parents c22ade5 + 3d1e2c6 commit 07a8fd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/actuators/machine/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ func (a *Actuator) Update(context context.Context, machine *machinev1.Machine) e
// Parent controller should prevent this from ever happening by calling Exists and then Create,
// but instance could be deleted between the two calls.
if existingLen == 0 {
if machine.Spec.ProviderID != nil && (machine.Status.LastUpdated == nil || machine.Status.LastUpdated.Add(requeueAfterSeconds*time.Second).After(time.Now())) {
if machine.Spec.ProviderID != nil && *machine.Spec.ProviderID != "" && (machine.Status.LastUpdated == nil || machine.Status.LastUpdated.Add(requeueAfterSeconds*time.Second).After(time.Now())) {
glog.Infof("%s: Possible eventual-consistency discrepancy; returning an error to requeue", machine.Name)
return &machinecontroller.RequeueAfterError{RequeueAfter: requeueAfterSeconds * time.Second}
}
Expand Down Expand Up @@ -502,7 +502,7 @@ func (a *Actuator) Describe(machine *machinev1.Machine) (*ec2.Instance, error) {
return nil, err
}
if len(instances) == 0 {
if machine.Spec.ProviderID != nil && (machine.Status.LastUpdated == nil || machine.Status.LastUpdated.Add(requeueAfterSeconds*time.Second).After(time.Now())) {
if machine.Spec.ProviderID != nil && *machine.Spec.ProviderID != "" && (machine.Status.LastUpdated == nil || machine.Status.LastUpdated.Add(requeueAfterSeconds*time.Second).After(time.Now())) {
glog.Infof("%s: Possible eventual-consistency discrepancy; returning an error to requeue", machine.Name)
return nil, &machinecontroller.RequeueAfterError{RequeueAfter: requeueAfterSeconds * time.Second}
}
Expand Down

0 comments on commit 07a8fd7

Please sign in to comment.