From ce155270c80d826a6e7c28c15b3461eb3ea9a8d5 Mon Sep 17 00:00:00 2001 From: Evans Mungai Date: Fri, 31 May 2024 07:23:56 +0100 Subject: [PATCH] fix: Use correct cron job kind when discovering API versions (#1554) * fix: Use correct cron job kind when discovering API versions * Fix failing e2e test --- pkg/collect/cluster_resources.go | 2 +- test/e2e/support-bundle/cluster_resources_e2e_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/collect/cluster_resources.go b/pkg/collect/cluster_resources.go index e4134fe3b..999c12f5e 100644 --- a/pkg/collect/cluster_resources.go +++ b/pkg/collect/cluster_resources.go @@ -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/v1", "CronJobs") + ok, err := discovery.HasResource(client, "batch/v1", "CronJob") if err != nil { return nil, map[string]string{"": err.Error()} } diff --git a/test/e2e/support-bundle/cluster_resources_e2e_test.go b/test/e2e/support-bundle/cluster_resources_e2e_test.go index 1849194c8..8aad8506e 100644 --- a/test/e2e/support-bundle/cluster_resources_e2e_test.go +++ b/test/e2e/support-bundle/cluster_resources_e2e_test.go @@ -26,7 +26,6 @@ func TestClusterResources(t *testing.T) { "pvs.json", "pod-disruption-budgets-errors.json", "resources.json", - "cronjobs-errors.json", "custom-resource-definitions.json", "groups.json", "priorityclasses.json", @@ -38,6 +37,7 @@ func TestClusterResources(t *testing.T) { }, { paths: []string{ + "cronjobs", "limitranges", "daemonsets", "deployments",