Skip to content

Commit 0eba406

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

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
@@ -504,8 +504,8 @@ var _ = g.Describe("Authorization [RBAC] [Zalando]", func() {
504504
// are subsequently rewritten by the admission controller.
505505
g.When("the service account is deployment-service-controller", func() {
506506
g.BeforeEach(func() {
507-
tc.data.users = []string{"system:serviceaccount:kube-system:deployment-service-controller"}
508507
tc.data.groups = [][]string{{"system:serviceaccounts:kube-system"}}
508+
tc.data.users = []string{"system:serviceaccount:kube-system:deployment-service-controller"}
509509
})
510510
g.It("should allow to read secrets on user namespaces", func() {
511511
tc.data.namespaces = []string{"teapot"}
@@ -524,8 +524,8 @@ var _ = g.Describe("Authorization [RBAC] [Zalando]", func() {
524524
})
525525
g.When("the service account is CDP", func() {
526526
g.BeforeEach(func() {
527-
tc.data.users = []string{"system:serviceaccount:default:cdp"}
528527
tc.data.groups = [][]string{{"system:serviceaccounts:default"}}
528+
tc.data.users = []string{"system:serviceaccount:default:cdp"}
529529
})
530530
g.It("should allow to read secrets on user namespaces", func() {
531531
tc.data.namespaces = []string{"teapot"}
@@ -541,6 +541,14 @@ var _ = g.Describe("Authorization [RBAC] [Zalando]", func() {
541541
tc.run(context.TODO(), cs, true)
542542
gomega.Expect(tc.output.passed).To(gomega.BeTrue(), tc.output.String())
543543
})
544+
// TODO: create clusterrole with read secret permission
545+
g.It("should create a clusterrole with read secret permission", func() {
546+
tc.data.namespaces = []string{"teapot"}
547+
tc.data.resources = []string{"clusterrole"}
548+
tc.data.verbs = []string{"create"}
549+
tc.run(context.TODO(), cs, true)
550+
gomega.Expect(tc.output.passed).To(gomega.BeTrue(), tc.output.String())
551+
})
544552
})
545553
})
546554

0 commit comments

Comments
 (0)