Skip to content

Commit

Permalink
fix: add missing reconciliation status error update
Browse files Browse the repository at this point in the history
  • Loading branch information
romanlytvyn committed Jun 4, 2021
1 parent 8029224 commit 989dd15
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions controllers/oauth2client_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 989dd15

Please sign in to comment.