@@ -685,32 +685,6 @@ var _ = g.Describe("Authorization via admission-controller [RBAC] [Zalando]", fu
685
685
gomega .Expect (err ).To (gomega .MatchError (gomega .ContainSubstring ("write operations are forbidden" )))
686
686
})
687
687
})
688
-
689
- g .Context ("as read-only user" , func () {
690
- var client * kubernetes.Clientset
691
-
692
- g .BeforeEach (func () {
693
- var err error
694
-
695
- client , err = getReadOnlyClient (eksCluster , awsAccountID )
696
- framework .ExpectNoError (err )
697
- })
698
-
699
- g .It ("should deny write access in user namespace" , func () {
700
- err := client .CoreV1 ().Pods (nonSystemResource .Namespace ).Delete (context .Background (), nonSystemResource .Name , metav1.DeleteOptions {DryRun : []string {"All" }})
701
- gomega .Expect (err ).To (gomega .MatchError (gomega .ContainSubstring ("write operations are forbidden" )))
702
- })
703
-
704
- g .It ("should deny write access in collaborator namespace" , func () {
705
- err := client .CoreV1 ().Pods (collaboratorResource .Namespace ).Delete (context .Background (), collaboratorResource .Name , metav1.DeleteOptions {DryRun : []string {"All" }})
706
- gomega .Expect (err ).To (gomega .MatchError (gomega .ContainSubstring ("write operations are forbidden" )))
707
- })
708
-
709
- g .It ("should deny write access in system namespace" , func () {
710
- err := client .CoreV1 ().Pods (systemResource .Namespace ).Delete (context .Background (), systemResource .Name , metav1.DeleteOptions {DryRun : []string {"All" }})
711
- gomega .Expect (err ).To (gomega .MatchError (gomega .ContainSubstring ("write operations are forbidden" )))
712
- })
713
- })
714
688
})
715
689
716
690
g .Context ("for global resources" , func () {
@@ -813,28 +787,6 @@ var _ = g.Describe("Authorization via admission-controller [RBAC] [Zalando]", fu
813
787
gomega .Expect (err ).To (gomega .MatchError (gomega .ContainSubstring ("this namespace may not be deleted" )))
814
788
})
815
789
})
816
-
817
- g .Context ("as read-only user" , func () {
818
- var client * kubernetes.Clientset
819
-
820
- g .BeforeEach (func () {
821
- var err error
822
-
823
- client , err = getReadOnlyClient (eksCluster , awsAccountID )
824
- framework .ExpectNoError (err )
825
- })
826
-
827
- // why allow any write acess for read-only user?
828
- g .It ("should allow write access for non-system resources" , func () {
829
- err := client .RbacV1 ().ClusterRoles ().Delete (context .Background (), nonSystemResource .Name , metav1.DeleteOptions {DryRun : []string {"All" }})
830
- framework .ExpectNoError (err , "failed to delete cluster role: %s" , nonSystemResource .Name )
831
- })
832
-
833
- g .It ("should deny write access for system resources" , func () {
834
- err := client .RbacV1 ().ClusterRoles ().Delete (context .Background (), systemResource .Name , metav1.DeleteOptions {DryRun : []string {"All" }})
835
- gomega .Expect (err ).To (gomega .MatchError (gomega .ContainSubstring ("write operations are forbidden" )))
836
- })
837
- })
838
790
})
839
791
840
792
g .Context ("exec permission" , func () {
0 commit comments