Skip to content

Commit

Permalink
Clearer error if AzureName is not set (#2366)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthchr authored Jun 29, 2022
1 parent 8e99791 commit 4ff3dde
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ func (r *azureDeploymentReconcilerInstance) MonitorDelete(ctx context.Context) (
}

func (r *azureDeploymentReconcilerInstance) BeginCreateOrUpdateResource(ctx context.Context) (ctrl.Result, error) {
if r.Obj.AzureName() == "" {
err := errors.New("AzureName was not set. A webhook should default this to .metadata.name if it was omitted. Is the ASO webhook service running?")
return ctrl.Result{}, conditions.NewReadyConditionImpactingError(err, conditions.ConditionSeverityError, conditions.ReasonFailed)
}

armResource, err := r.ConvertResourceToARMResource(ctx)
if err != nil {
return ctrl.Result{}, err
Expand Down

0 comments on commit 4ff3dde

Please sign in to comment.