diff --git a/pkg/gatherers/clusterconfig/const.go b/pkg/gatherers/clusterconfig/const.go index 684210de4..4945b12f3 100644 --- a/pkg/gatherers/clusterconfig/const.go +++ b/pkg/gatherers/clusterconfig/const.go @@ -18,7 +18,7 @@ var ( // logTailLinesLong sets the maximum number of lines to fetch from long pod logs logTailLinesLong = int64(400) - defaultNamespaces = []string{"default", "kube-system", "kube-public"} + defaultNamespaces = []string{"default", "kube-system", "kube-public", "openshift"} datahubGroupVersionResource = schema.GroupVersionResource{ Group: "installers.datahub.sap.com", Version: "v1alpha1", Resource: "datahubs", } diff --git a/pkg/gatherers/clusterconfig/container_images.go b/pkg/gatherers/clusterconfig/container_images.go index 72c9e6947..071766cee 100644 --- a/pkg/gatherers/clusterconfig/container_images.go +++ b/pkg/gatherers/clusterconfig/container_images.go @@ -67,7 +67,7 @@ func gatherContainerImages(ctx context.Context, coreClient corev1client.CoreV1In for podIndex, pod := range pods.Items { //nolint:gocritic podPtr := &pods.Items[podIndex] - if strings.HasPrefix(pod.Namespace, "openshift") && check.HasContainerInCrashloop(podPtr) { + if strings.HasPrefix(pod.Namespace, "openshift-") && check.HasContainerInCrashloop(podPtr) { records = append(records, record.Record{ Name: fmt.Sprintf("config/pod/%s/%s", pod.Namespace, pod.Name), Item: record.JSONMarshaller{Object: podPtr}, diff --git a/pkg/gatherers/clusterconfig/install_plans.go b/pkg/gatherers/clusterconfig/install_plans.go index 0c60dfa6d..598dceab0 100644 --- a/pkg/gatherers/clusterconfig/install_plans.go +++ b/pkg/gatherers/clusterconfig/install_plans.go @@ -63,9 +63,9 @@ func gatherInstallPlans(ctx context.Context, if err != nil { return nil, []error{err} } - // collect from all openshift* namespaces + // collect from openshift and all openshift-* namespaces for i := range config.Items { - if !strings.HasPrefix(config.Items[i].Name, "openshift") { + if config.Items[i].Name != "openshift" && !strings.HasPrefix(config.Items[i].Name, "openshift-") { continue } resInterface := dynamicClient.Resource(opResource).Namespace(config.Items[i].Name) diff --git a/pkg/gatherers/clusterconfig/service_accounts.go b/pkg/gatherers/clusterconfig/service_accounts.go index 58c68af4d..f6dae6cae 100644 --- a/pkg/gatherers/clusterconfig/service_accounts.go +++ b/pkg/gatherers/clusterconfig/service_accounts.go @@ -53,9 +53,9 @@ func gatherServiceAccounts(ctx context.Context, coreClient corev1client.CoreV1In var serviceAccounts []corev1.ServiceAccount var records []record.Record namespaces := defaultNamespaces - // collect from all openshift* namespaces + kubernetes defaults + // collect from all openshift-* namespaces + kubernetes defaults for i := range config.Items { - if strings.HasPrefix(config.Items[i].Name, "openshift") { + if strings.HasPrefix(config.Items[i].Name, "openshift-") { namespaces = append(namespaces, config.Items[i].Name) } }