Skip to content

Commit

Permalink
Update the status when the product not found
Browse files Browse the repository at this point in the history
  • Loading branch information
austincunningham committed Aug 5, 2022
1 parent ba09ba6 commit a370bcd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions controllers/capabilities/proxyconfigpromote_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ func (r *ProxyConfigPromoteReconciler) Reconcile(req ctrl.Request) (ctrl.Result,
err = r.Client().Get(r.Context(), projectMeta, product)
if err != nil {
if errors.IsNotFound(err) {
reqLogger.Info("resource not found. Ignoring since object must have been deleted")
statusReconciler := NewProxyConfigPromoteStatusReconciler(r.BaseReconciler, proxyConfigPromote, "Failed", "product not found", 0, 0, err)
statusReconciler.Reconcile()
reqLogger.Info("product not found. Ignoring since object must have been deleted")
return ctrl.Result{}, err
}
return ctrl.Result{}, err
Expand All @@ -100,7 +102,7 @@ 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 proxyConfigPromote: %v. Failed to update proxyConfigPromote status: %w", reconcileErr, statusUpdateErr)
}

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

0 comments on commit a370bcd

Please sign in to comment.