Skip to content

Commit

Permalink
disable serviceImport (#260)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Zhang <[email protected]>
  • Loading branch information
ryanzhang-oss and Ryan Zhang authored Sep 6, 2022
1 parent 6cfdf2e commit 44551d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions pkg/utils/apiresources.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ var (
Kind: "Node",
}

serviceImportGVK = schema.GroupVersionKind{
Group: NetworkingGroupName,
Version: "v1alpha1",
Kind: "ServiceImport",
}

// we use `;` to separate the different api groups
apiGroupSepToken = ";"
)
Expand Down Expand Up @@ -61,6 +67,7 @@ func NewDisabledResourceConfig() *DisabledResourceConfig {
r.DisableGroup(coordv1.GroupName)
r.DisableGroupVersionKind(corev1PodGVK)
r.DisableGroupVersionKind(corev1NodeGVK)
r.DisableGroupVersionKind(serviceImportGVK)
return r
}

Expand Down
6 changes: 5 additions & 1 deletion pkg/utils/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ const (
// PlacementFinalizer is used to make sure that we handle gc of placement resources
PlacementFinalizer = "work.fleet.azure.com/placement-protection"
)
const (
// NetworkingGroupName is the group name of the fleet networking
NetworkingGroupName = "networking.fleet.azure.com"
)

var (
FleetRule = rbacv1.PolicyRule{
Expand All @@ -75,7 +79,7 @@ var (
}
FleetNetworkRule = rbacv1.PolicyRule{
Verbs: []string{"*"},
APIGroups: []string{"networking.fleet.azure.com"},
APIGroups: []string{NetworkingGroupName},
Resources: []string{"*"},
}
// LeaseRule Leases permissions are required for leader election of hub controller manager in member cluster.
Expand Down

0 comments on commit 44551d3

Please sign in to comment.