Skip to content

Commit

Permalink
Publish event when failed to update secret status
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunyiLyu committed Mar 25, 2021
1 parent b59a5b4 commit 802d0c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/user_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ func (r *UserReconciler) setUserStatus(ctx context.Context, user *topology.User)
}
user.Status.Credentials = credentials
if err := r.Status().Update(ctx, user); err != nil {
logger.Error(err, "Failed to update secret status credentials", "user", user.Name, "secretRef", credentials)
msg := "Failed to update secret status credentials"
r.Recorder.Event(user, corev1.EventTypeWarning, "FailedStatusUpdate", msg)
logger.Error(err, msg, "user", user.Name, "secretRef", credentials)
return err
}
logger.Info("Successfully updated secret status credentials", "user", user.Name, "secretRef", credentials)
Expand Down

0 comments on commit 802d0c4

Please sign in to comment.