Skip to content

Commit b125bf0

Browse files
committed
testcase: cdp user creates clusterrole with read secret permission
Signed-off-by: Katyanna Moura <[email protected]>
1 parent 4361d4b commit b125bf0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/e2e/authorization.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ var _ = g.Describe("Authorization [RBAC] [Zalando]", func() {
512512
// are subsequently rewritten by the admission controller.
513513
g.When("the service account is deployment-service-controller", func() {
514514
g.BeforeEach(func() {
515-
tc.data.users = []string{"system:serviceaccount:kube-system:deployment-service-controller"}
516515
tc.data.groups = [][]string{{"system:serviceaccounts:kube-system"}}
516+
tc.data.users = []string{"system:serviceaccount:kube-system:deployment-service-controller"}
517517
})
518518
g.It("should allow to read secrets on user namespaces", func() {
519519
tc.data.namespaces = []string{"teapot"}
@@ -532,8 +532,8 @@ var _ = g.Describe("Authorization [RBAC] [Zalando]", func() {
532532
})
533533
g.When("the service account is CDP", func() {
534534
g.BeforeEach(func() {
535-
tc.data.users = []string{"system:serviceaccount:default:cdp"}
536535
tc.data.groups = [][]string{{"system:serviceaccounts:default"}}
536+
tc.data.users = []string{"system:serviceaccount:default:cdp"}
537537
})
538538
g.It("should allow to read secrets on user namespaces", func() {
539539
tc.data.namespaces = []string{"teapot"}
@@ -549,6 +549,14 @@ var _ = g.Describe("Authorization [RBAC] [Zalando]", func() {
549549
tc.run(context.TODO(), cs, true)
550550
gomega.Expect(tc.output.passed).To(gomega.BeTrue(), tc.output.String())
551551
})
552+
// TODO: create clusterrole with read secret permission
553+
g.It("should create a clusterrole with read secret permission", func() {
554+
tc.data.namespaces = []string{"teapot"}
555+
tc.data.resources = []string{"clusterrole"}
556+
tc.data.verbs = []string{"create"}
557+
tc.run(context.TODO(), cs, true)
558+
gomega.Expect(tc.output.passed).To(gomega.BeTrue(), tc.output.String())
559+
})
552560
})
553561
})
554562

0 commit comments

Comments
 (0)