From 989dd1567a45b1960ec872218328d364a9e086a7 Mon Sep 17 00:00:00 2001 From: Roman Lytvyn Date: Fri, 4 Jun 2021 13:48:35 +0200 Subject: [PATCH] fix: add missing reconciliation status error update --- controllers/oauth2client_controller.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/controllers/oauth2client_controller.go b/controllers/oauth2client_controller.go index 06e2e7d..6c519f2 100644 --- a/controllers/oauth2client_controller.go +++ b/controllers/oauth2client_controller.go @@ -207,7 +207,10 @@ func (r *OAuth2ClientReconciler) registerOAuth2Client(ctx context.Context, c *hy oauth2client, err := c.ToOAuth2ClientJSON() if err != nil { - return err + if updateErr := r.updateReconciliationStatusError(ctx, c, hydrav1alpha1.StatusRegistrationFailed, err); updateErr != nil { + return updateErr + } + return nil } if credentials != nil { @@ -264,7 +267,10 @@ func (r *OAuth2ClientReconciler) updateRegisteredOAuth2Client(ctx context.Contex oauth2client, err := c.ToOAuth2ClientJSON() if err != nil { - return err + if updateErr := r.updateReconciliationStatusError(ctx, c, hydrav1alpha1.StatusRegistrationFailed, err); updateErr != nil { + return updateErr + } + return nil } if _, err := hydra.PutOAuth2Client(oauth2client.WithCredentials(credentials)); err != nil {