Skip to content

Commit

Permalink
unused namespace in ensureUserIdentityAndGroups tests (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatousJobanek authored Sep 16, 2024
1 parent 69407f2 commit a120896
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/generate/permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func ensureServiceAccount(saNamespace string) newSubjectFunc {

// ensureUserIdentityAndGroups ensures that all - User, Identity, IdentityMapping, and Group manifests - exist
func ensureUserIdentityAndGroups(IDs []string, groups []string) newSubjectFunc {
return func(ctx *clusterContext, cache objectsCache, subjectBaseName, targetNamespace string, labels map[string]string) (rbacv1.Subject, error) {
return func(ctx *clusterContext, cache objectsCache, subjectBaseName, _ string, labels map[string]string) (rbacv1.Subject, error) {
// create user
user := &userv1.User{
ObjectMeta: metav1.ObjectMeta{
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/generate/permissions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func TestEnsureUserAndIdentity(t *testing.T) {
cache := objectsCache{}

// when
subject, err := ensureUserIdentityAndGroups([]string{"12345", "abc:19944:FZZ"}, []string{"crtadmins", "cooladmins"})(ctx, cache, "john-crtadmin", commontest.HostOperatorNs, labels)
subject, err := ensureUserIdentityAndGroups([]string{"12345", "abc:19944:FZZ"}, []string{"crtadmins", "cooladmins"})(ctx, cache, "john-crtadmin", "not-used", labels)

// then
require.NoError(t, err)
Expand All @@ -156,7 +156,7 @@ func TestEnsureUserAndIdentity(t *testing.T) {
cache := objectsCache{}

// when
subject, err := ensureUserIdentityAndGroups([]string{"12345", "abc:19944:FZZ"}, []string{})(ctx, cache, "john-crtadmin", commontest.HostOperatorNs, labels)
subject, err := ensureUserIdentityAndGroups([]string{"12345", "abc:19944:FZZ"}, []string{})(ctx, cache, "john-crtadmin", "not-used", labels)

// then
require.NoError(t, err)
Expand All @@ -175,7 +175,7 @@ func TestEnsureUserAndIdentity(t *testing.T) {
cache := objectsCache{}

// when
_, err := ensureUserIdentityAndGroups([]string{"12345"}, []string{})(ctx, cache, "john-crtadmin", commontest.HostOperatorNs, labels)
_, err := ensureUserIdentityAndGroups([]string{"12345"}, []string{})(ctx, cache, "john-crtadmin", "not-used", labels)

// then
require.NoError(t, err)
Expand Down

0 comments on commit a120896

Please sign in to comment.