Skip to content

Commit

Permalink
Remove redundant logs
Browse files Browse the repository at this point in the history
- same error and msgs are logged in declareUser and deleteUser
  • Loading branch information
ChunyiLyu committed Mar 25, 2021
1 parent 802d0c4 commit 6cfacb3
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions controllers/user_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,18 +288,13 @@ func (r *UserReconciler) addFinalizerIfNeeded(ctx context.Context, user *topolog
}

func (r *UserReconciler) getUserCredentials(ctx context.Context, user *topology.User) (*corev1.Secret, error) {
logger := ctrl.LoggerFrom(ctx)
if user.Status.Credentials == nil {
return nil, fmt.Errorf("this User does not yet have a Credentials Secret created")
}

credentials := &corev1.Secret{}
if err := r.Get(ctx, types.NamespacedName{Name: user.Status.Credentials.Name, Namespace: user.Namespace}, credentials); err != nil {
logger.Error(err, "Failed to retrieve user credentials secret from status", "user", user.Name, "secretCredentials", user.Status.Credentials)
return nil, err
}

logger.Info("Successfully retrieved credentials", "user", user.Name, "secretCredentials", user.Status.Credentials)
return credentials, nil
}

Expand Down

0 comments on commit 6cfacb3

Please sign in to comment.