Skip to content

Commit

Permalink
Checking for 400 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
haagha committed Jul 10, 2020
1 parent 9ef9d28 commit d6268d6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/resourcemanager/vm/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,18 @@ func (g *AzureVirtualMachineClient) Ensure(ctx context.Context, obj runtime.Obje
case errhelp.AsyncOpIncompleteError:
instance.Status.Provisioning = true
instance.Status.Message = err.Error()

}
// reconciliation is not done but error is acceptable
return false, nil
}
//change to spec is required
if future.Response().StatusCode == 400 {
instance.Status.FailedProvisioning = true
instance.Status.Message = err.Error()
return false, nil
}

// reconciliation not done and we don't know what happened
return false, err
}
Expand Down Expand Up @@ -135,6 +143,7 @@ func (g *AzureVirtualMachineClient) Ensure(ctx context.Context, obj runtime.Obje
// reconciliation is not done but error is acceptable
return false, nil
}

// reconciliation not done and we don't know what happened
return false, err
}
Expand Down

0 comments on commit d6268d6

Please sign in to comment.