Skip to content

Commit 5c87558

Browse files
committed
UPSTREAM: 131409: test/e2e/node/kubelet_authz.go: fix SAR to include SA groups
1 parent 1fb5099 commit 5c87558

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

test/e2e/framework/auth/helpers.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ type bindingsGetter interface {
4646

4747
// WaitForAuthzUpdate checks if the give user can perform named verb and action
4848
// on a resource or subresource.
49-
func WaitForAuthzUpdate(ctx context.Context, c v1authorization.SubjectAccessReviewsGetter, user string, ra *authorizationv1.ResourceAttributes, allowed bool) error {
49+
func WaitForAuthzUpdate(ctx context.Context, c v1authorization.SubjectAccessReviewsGetter, user string, groups []string, ra *authorizationv1.ResourceAttributes, allowed bool) error {
5050
review := &authorizationv1.SubjectAccessReview{
5151
Spec: authorizationv1.SubjectAccessReviewSpec{
5252
ResourceAttributes: ra,
5353
User: user,
54+
Groups: groups,
5455
},
5556
}
5657

test/e2e/node/kubelet_authz.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ func runKubeletAuthzTest(ctx context.Context, f *framework.Framework, endpoint,
108108

109109
err = e2eauth.WaitForAuthzUpdate(ctx, f.ClientSet.AuthorizationV1(),
110110
serviceaccount.MakeUsername(ns, saName),
111+
append(serviceaccount.MakeGroupNames(ns), "system:authenticated"),
111112
&authorizationv1.ResourceAttributes{
112113
Namespace: ns,
113114
Verb: verb,

0 commit comments

Comments
 (0)