Skip to content

Commit

Permalink
TODO removal
Browse files Browse the repository at this point in the history
  • Loading branch information
phlg committed Aug 13, 2024
1 parent 0e162b2 commit 57a7f12
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions controllers/user_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,6 @@ func (r *S3UserReconciler) getUserSecret(ctx context.Context, userResource *s3v1
userSecret := corev1.Secret{}

err := r.List(ctx, secretsList, client.InNamespace(userResource.Namespace))
// TODO : check if the errors.IsNotFound makes sense for r.List
// if err != nil && (errors.IsNotFound(err) || len(secretsList.Items) == 0) {
if err != nil {
logger.Error(err, "An error occurred while listing the secrets in user's namespace")
return userSecret, fmt.Errorf("SecretListingFailed")
Expand Down Expand Up @@ -526,6 +524,7 @@ func (r *S3UserReconciler) finalizeS3User(userResource *s3v1alpha1.S3User) error
func (r *S3UserReconciler) newSecretForCR(ctx context.Context, userResource *s3v1alpha1.S3User, data map[string][]byte) (*corev1.Secret, error) {
logger := log.FromContext(ctx)

// Reusing the S3User's labels and annotations
labels := map[string]string{}
for k, v := range userResource.ObjectMeta.Labels {
labels[k] = v
Expand Down

0 comments on commit 57a7f12

Please sign in to comment.