Skip to content

Commit 44551d3

Browse files
ryanzhang-ossRyan Zhang
andauthored
disable serviceImport (#260)
Co-authored-by: Ryan Zhang <zhangryan@microsoft.com>
1 parent 6cfdf2e commit 44551d3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

pkg/utils/apiresources.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ var (
3131
Kind: "Node",
3232
}
3333

34+
serviceImportGVK = schema.GroupVersionKind{
35+
Group: NetworkingGroupName,
36+
Version: "v1alpha1",
37+
Kind: "ServiceImport",
38+
}
39+
3440
// we use `;` to separate the different api groups
3541
apiGroupSepToken = ";"
3642
)
@@ -61,6 +67,7 @@ func NewDisabledResourceConfig() *DisabledResourceConfig {
6167
r.DisableGroup(coordv1.GroupName)
6268
r.DisableGroupVersionKind(corev1PodGVK)
6369
r.DisableGroupVersionKind(corev1NodeGVK)
70+
r.DisableGroupVersionKind(serviceImportGVK)
6471
return r
6572
}
6673

pkg/utils/common.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ const (
5656
// PlacementFinalizer is used to make sure that we handle gc of placement resources
5757
PlacementFinalizer = "work.fleet.azure.com/placement-protection"
5858
)
59+
const (
60+
// NetworkingGroupName is the group name of the fleet networking
61+
NetworkingGroupName = "networking.fleet.azure.com"
62+
)
5963

6064
var (
6165
FleetRule = rbacv1.PolicyRule{
@@ -75,7 +79,7 @@ var (
7579
}
7680
FleetNetworkRule = rbacv1.PolicyRule{
7781
Verbs: []string{"*"},
78-
APIGroups: []string{"networking.fleet.azure.com"},
82+
APIGroups: []string{NetworkingGroupName},
7983
Resources: []string{"*"},
8084
}
8185
// LeaseRule Leases permissions are required for leader election of hub controller manager in member cluster.

0 commit comments

Comments
 (0)