Skip to content

Commit

Permalink
rename parameter to userUID
Browse files Browse the repository at this point in the history
  • Loading branch information
ranakan19 committed May 21, 2024
1 parent afd558d commit de45e6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions controllers/useraccount/useraccount_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,21 +493,21 @@ func (r *Reconciler) deleteUser(ctx context.Context, userAcc *toolchainv1alpha1.

// Returns `true` if the associated resources (configMap, role and role-binding) created for a user by console are deleted, `false` otherwise.
// This function only looks for these resources in the namespace - openshift-console-user-settings
func (r *Reconciler) deleteUserResources(ctx context.Context, userID string) error {
func (r *Reconciler) deleteUserResources(ctx context.Context, userUID string) error {

// Users which were created in the cluster with the OCP versions which includes https://issues.redhat.com/browse/OCPBUGS-32321 fix
// will have a label which will help to map the User to the User settings resources.

// Users created before that won't have that label, and we have to rely on the name of the resource being of type `user-settings-<UID>`,
// where <UID> is the User's UID.
// delete ConfigMap, Role and RoleBinding
if _, err := deleteConfigMap(ctx, r.Client, userID); err != nil {
if _, err := deleteConfigMap(ctx, r.Client, userUID); err != nil {
return err

Check warning on line 505 in controllers/useraccount/useraccount_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/useraccount/useraccount_controller.go#L505

Added line #L505 was not covered by tests
}
if _, err := deleteRole(ctx, r.Client, userID); err != nil {
if _, err := deleteRole(ctx, r.Client, userUID); err != nil {
return err

Check warning on line 508 in controllers/useraccount/useraccount_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/useraccount/useraccount_controller.go#L508

Added line #L508 was not covered by tests
}
if _, err := deleteRoleBinding(ctx, r.Client, userID); err != nil {
if _, err := deleteRoleBinding(ctx, r.Client, userUID); err != nil {
return err

Check warning on line 511 in controllers/useraccount/useraccount_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/useraccount/useraccount_controller.go#L511

Added line #L511 was not covered by tests
}
return nil
Expand Down

0 comments on commit de45e6b

Please sign in to comment.