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 {