@@ -43,8 +43,8 @@ func TestAuthorizationOrder(t *testing.T) {
4343 webhookPort := "8080"
4444 ctx , cancelFunc := context .WithCancel (context .Background ())
4545 t .Cleanup (cancelFunc )
46- webhookStop := RunWebhook (ctx , t , webhookPort , "kubernetes:authz:allow" )
47- t .Cleanup (webhookStop )
46+ webhook1Stop := RunWebhook (ctx , t , webhookPort , "kubernetes:authz:allow" )
47+ t .Cleanup (webhook1Stop )
4848
4949 server , kcpClusterClient , kubeClusterClient := setupTest (t , "AlwaysAllowGroups,AlwaysAllowPaths,Webhook,RBAC" , "testdata/webhook1.kubeconfig" )
5050
@@ -53,9 +53,9 @@ func TestAuthorizationOrder(t *testing.T) {
5353 require .NoError (t , err )
5454
5555 // stop the webhook and switch to a deny policy
56- webhookStop ()
57- webhookStop = RunWebhook (ctx , t , webhookPort , "kubernetes:authz:deny" )
58- t .Cleanup (webhookStop )
56+ webhook1Stop ()
57+ webhook2Stop : = RunWebhook (ctx , t , webhookPort , "kubernetes:authz:deny" )
58+ t .Cleanup (webhook2Stop )
5959
6060 t .Log ("Admin should not be allowed to list ConfigMaps." )
6161 _ , err = kubeClusterClient .Cluster (logicalcluster .NewPath ("root" )).CoreV1 ().ConfigMaps ("default" ).List (ctx , metav1.ListOptions {})
@@ -70,8 +70,8 @@ func TestAuthorizationOrder(t *testing.T) {
7070 webhookPort := "8081"
7171 ctx , cancelFunc := context .WithCancel (context .Background ())
7272 t .Cleanup (cancelFunc )
73- webhookStop := RunWebhook (ctx , t , webhookPort , "kubernetes:authz:allow" )
74- t .Cleanup (webhookStop )
73+ webhook1Stop := RunWebhook (ctx , t , webhookPort , "kubernetes:authz:allow" )
74+ t .Cleanup (webhook1Stop )
7575
7676 server , kcpClusterClient , kubeClusterClient := setupTest (t , "Webhook,AlwaysAllowGroups,AlwaysAllowPaths,RBAC" , "testdata/webhook2.kubeconfig" )
7777
@@ -83,9 +83,9 @@ func TestAuthorizationOrder(t *testing.T) {
8383 require .NoError (t , err )
8484
8585 // stop the webhook and switch to a deny policy
86- webhookStop ()
87- webhookStop = RunWebhook (ctx , t , webhookPort , "kubernetes:authz:deny" )
88- t .Cleanup (webhookStop )
86+ webhook1Stop ()
87+ webhook2Stop : = RunWebhook (ctx , t , webhookPort , "kubernetes:authz:deny" )
88+ t .Cleanup (webhook2Stop )
8989
9090 t .Log ("Admin should not be allowed now to list Logical clusters." )
9191 _ , err = kcpClusterClient .Cluster (logicalcluster .NewPath ("root" )).CoreV1alpha1 ().LogicalClusters ().List (ctx , metav1.ListOptions {})
0 commit comments