Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pkg/utils/apiresources.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ var (
Kind: "ServiceImport",
}

trafficManagerProfileGVK = schema.GroupVersionKind{
Group: NetworkingGroupName,
Version: "v1alpha1",
Kind: "TrafficManagerProfile",
}

trafficManagerBackendGVK = schema.GroupVersionKind{
Group: NetworkingGroupName,
Version: "v1alpha1",
Kind: "TrafficManagerBackend",
}

// we use `;` to separate the different api groups
apiGroupSepToken = ";"
)
Expand Down Expand Up @@ -81,7 +93,10 @@ func NewResourceConfig(isAllowList bool) *ResourceConfig {
r.AddGroup(metricsV1beta1.GroupName)
r.AddGroupVersionKind(corev1PodGVK)
r.AddGroupVersionKind(corev1NodeGVK)
// disable networking resources
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should add the entire fleet-network group instead of one by one

Copy link
Contributor Author

@zhiying-lin zhiying-lin Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it depends. for example, the serviceExport and mcs should be placed to the members.

Validated that we don't support disabling all networking gvk but excluding the serviceExport and mcs today. Could be a future improvement task.

r.AddGroupVersionKind(serviceImportGVK)
r.AddGroupVersionKind(trafficManagerProfileGVK)
r.AddGroupVersionKind(trafficManagerBackendGVK)
return r
}

Expand Down
20 changes: 20 additions & 0 deletions pkg/utils/apiresources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,21 @@ func TestDefaultResourceConfigGroupVersionKindParse(t *testing.T) {
Version: "v1beta1",
Kind: "Event",
},
{
Group: "networking.fleet.azure.com",
Version: "v1alpha1",
Kind: "ServiceImport",
},
{
Group: "networking.fleet.azure.com",
Version: "v1alpha1",
Kind: "TrafficManagerProfile",
},
{
Group: "networking.fleet.azure.com",
Version: "v1alpha1",
Kind: "TrafficManagerBackend",
},
}

resourcesNotInDefaultResourcesList := []schema.GroupVersionKind{
Expand All @@ -306,6 +321,11 @@ func TestDefaultResourceConfigGroupVersionKindParse(t *testing.T) {
Version: "v1",
Kind: "Event",
},
{
Group: "networking.fleet.azure.com",
Version: "v1alpha1",
Kind: "ServiceExport",
},
}

tests := map[string]struct {
Expand Down
Loading