Skip to content

Commit a828d88

Browse files
author
Nont
committed
Remove system:serviceaccounts:openshift-kube-controller-manager
Signed-off-by: Nont <[email protected]>
1 parent 9066d2d commit a828d88

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

pkg/webhook/managedresource/createordelete_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,11 +373,9 @@ func TestGetVAPBindingWithMutator(t *testing.T) {
373373
// Verify initial state
374374
if vapb == nil {
375375
t.Fatal("getVAPBindingWithMutator() returned nil VAP binding")
376-
return
377376
}
378377
if mutateFunc == nil {
379378
t.Fatal("getVAPBindingWithMutator() returned nil mutate function")
380-
return
381379
}
382380

383381
// Verify mutate function works

pkg/webhook/managedresource/validatingadmissionpolicy.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ func mutateValidatingAdmissionPolicy(vap *admv1.ValidatingAdmissionPolicy) {
6363
(
6464
"system:masters" in request.userInfo.groups ||
6565
"system:serviceaccounts:kube-system" in request.userInfo.groups ||
66-
"system:serviceaccounts:fleet-system" in request.userInfo.groups ||
67-
"system:serviceaccounts:openshift-kube-controller-manager" in request.userInfo.groups
66+
"system:serviceaccounts:fleet-system" in request.userInfo.groups
6867
)
6968
)
7069
||

test/e2e/managed_resource_vap_test.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
"k8s.io/apimachinery/pkg/types"
3636
"k8s.io/apimachinery/pkg/util/version"
3737
"k8s.io/client-go/discovery"
38-
3938
"sigs.k8s.io/controller-runtime/pkg/client"
4039

4140
placementv1beta1 "go.goms.io/fleet/apis/placement/v1beta1"
@@ -53,16 +52,6 @@ var managedByLabelMap = map[string]string{
5352
managedByLabel: managedByLabelValue,
5453
}
5554

56-
// Need this because Entry() evaluates parameters at definition time, not at runtime.
57-
// Without this, the client value sent to Entry() would always be nil.
58-
func getUserClient() client.Client {
59-
return hubCluster.ImpersonateKubeClient
60-
}
61-
62-
func getAksServiceClient() client.Client {
63-
return hubCluster.SystemMastersClient
64-
}
65-
6655
var _ = Describe("ValidatingAdmissionPolicy for Managed Resources", Label("managedresource"), Ordered, func() {
6756
BeforeEach(func() {
6857
discoveryClient := framework.GetDiscoveryClient(hubCluster)
@@ -520,3 +509,13 @@ func isAPIServerVersionAtLeast(disco discovery.DiscoveryInterface, targetVersion
520509
server, target := version.MustParseSemantic(serverVersion.GitVersion), version.MustParseSemantic(targetVersion)
521510
return server.AtLeast(target), nil
522511
}
512+
513+
// Need this because Entry() evaluates parameters at definition time, not at runtime.
514+
// Without this, the client value sent to Entry() would always be nil.
515+
func getUserClient() client.Client {
516+
return hubCluster.ImpersonateKubeClient
517+
}
518+
519+
func getAksServiceClient() client.Client {
520+
return hubCluster.SystemMastersClient
521+
}

0 commit comments

Comments
 (0)