Skip to content

Commit

Permalink
update the status on the developer account not found
Browse files Browse the repository at this point in the history
  • Loading branch information
austincunningham committed Oct 7, 2022
1 parent 010db0f commit 32a0821
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion controllers/capabilities/application_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,19 @@ func (r *ApplicationReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)
err = r.Client().Get(r.Context(), projectMeta, accountResource)
if err != nil {
if apierrors.IsNotFound(err) {
return ctrl.Result{}, err
reqLogger.Error(err, "error developer account not found ")
statusReconciler := NewApplicationStatusReconciler(r.BaseReconciler, application, nil, "", err)
statusResult, statusUpdateErr := statusReconciler.Reconcile()
if statusUpdateErr != nil {
if err != nil {
return ctrl.Result{}, fmt.Errorf("Failed to reconcile application: %v. Failed to update application status: %w", err, statusUpdateErr)
}

return ctrl.Result{}, fmt.Errorf("Failed to update applicatino status: %w", statusUpdateErr)
}
if statusResult.Requeue {
return statusResult, nil
}
}
}
// get providerAccountRef from account
Expand Down
4 changes: 2 additions & 2 deletions controllers/capabilities/proxyconfigpromote_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ func (r *ProxyConfigPromoteReconciler) Reconcile(req ctrl.Request) (ctrl.Result,
statusResult, statusUpdateErr := statusReconciler.Reconcile()
if statusUpdateErr != nil {
if reconcileErr != nil {
return ctrl.Result{}, fmt.Errorf("Failed to reconcile activedoc: %v. Failed to update activedoc status: %w", reconcileErr, statusUpdateErr)
return ctrl.Result{}, fmt.Errorf("Failed to reconcile proxy config promote: %v. Failed to update proxy config promote status: %w", reconcileErr, statusUpdateErr)
}

return ctrl.Result{}, fmt.Errorf("Failed to update activedoc status: %w", statusUpdateErr)
return ctrl.Result{}, fmt.Errorf("Failed to update proxy config promote status: %w", statusUpdateErr)
}

if statusResult.Requeue {
Expand Down

0 comments on commit 32a0821

Please sign in to comment.