From 772d867093f1085e59646a332855c30086bf40c2 Mon Sep 17 00:00:00 2001 From: Gerard Nguyen Date: Fri, 9 Feb 2024 06:17:55 +1100 Subject: [PATCH] update correct K8S API group for batch and policy (#1461) --- pkg/collect/cluster_resources.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/collect/cluster_resources.go b/pkg/collect/cluster_resources.go index 28cb8ab3a..e4134fe3b 100644 --- a/pkg/collect/cluster_resources.go +++ b/pkg/collect/cluster_resources.go @@ -506,7 +506,7 @@ func pods(ctx context.Context, client *kubernetes.Clientset, namespaces []string } func getPodDisruptionBudgets(ctx context.Context, client *kubernetes.Clientset, namespaces []string) (map[string][]byte, map[string]string) { - ok, err := discovery.HasResource(client, "policy.k8s.io/v1", "PodDisruptionBudgets") + ok, err := discovery.HasResource(client, "policy/v1", "PodDisruptionBudgets") if err != nil { return nil, map[string]string{"": err.Error()} } @@ -801,7 +801,7 @@ func jobs(ctx context.Context, client *kubernetes.Clientset, namespaces []string } func cronJobs(ctx context.Context, client *kubernetes.Clientset, namespaces []string) (map[string][]byte, map[string]string) { - ok, err := discovery.HasResource(client, "batch.k8s.io/v1", "CronJobs") + ok, err := discovery.HasResource(client, "batch/v1", "CronJobs") if err != nil { return nil, map[string]string{"": err.Error()} }