Skip to content

Commit fa960d2

Browse files
committed
fix: consider capsuleconfiguration status users
Signed-off-by: Oliver Baehler <oliver@sudo-i.net>
1 parent 26b1823 commit fa960d2

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

internal/controllers/capsule_configuration.go

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,16 @@ func (c *CapsuleConfiguration) Reconcile(ctx context.Context, request reconcile.
5959
panic(err)
6060
}
6161

62-
//nolint:staticcheck
63-
allGroups := append(
64-
append([]string{}, capsuleConfig.Spec.UserGroups...), // copy to avoid aliasing
65-
capsuleConfig.Spec.Users.GetByKinds(
66-
[]capsulerbac.OwnerKind{capsulerbac.GroupOwner},
67-
)...,
62+
allGroups := capsuleConfig.Status.Users.GetByKinds(
63+
[]capsulerbac.OwnerKind{capsulerbac.GroupOwner},
6864
)
6965

7066
CapsuleUserGroups = sets.New[string](allGroups...)
7167

72-
//nolint:staticcheck
73-
allUsers := append(
74-
append([]string{}, capsuleConfig.Spec.UserNames...), // copy base slice
75-
capsuleConfig.Spec.Users.GetByKinds([]capsulerbac.OwnerKind{
76-
capsulerbac.UserOwner,
77-
capsulerbac.ServiceAccountOwner,
78-
})...,
79-
)
68+
allUsers := capsuleConfig.Status.Users.GetByKinds([]capsulerbac.OwnerKind{
69+
capsulerbac.UserOwner,
70+
capsulerbac.ServiceAccountOwner,
71+
})
8072

8173
CapsuleUsers = sets.New[string](allUsers...)
8274

0 commit comments

Comments
 (0)