From 74b490267c031e559d13b09a411511f93cfcdbb0 Mon Sep 17 00:00:00 2001 From: Ivo Meixner Date: Thu, 22 Apr 2021 12:28:58 +0200 Subject: [PATCH] Remove coreClient from PNCC gatherer --- .../clusterconfig/pod_network_connectivity_checks.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pkg/gather/clusterconfig/pod_network_connectivity_checks.go b/pkg/gather/clusterconfig/pod_network_connectivity_checks.go index dc6e50c59f..e0b67a2cb6 100644 --- a/pkg/gather/clusterconfig/pod_network_connectivity_checks.go +++ b/pkg/gather/clusterconfig/pod_network_connectivity_checks.go @@ -8,8 +8,6 @@ import ( controlplanev1 "github.com/openshift/api/operatorcontrolplane/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/dynamic" - "k8s.io/client-go/kubernetes" - corev1client "k8s.io/client-go/kubernetes/typed/core/v1" "github.com/openshift/insights-operator/pkg/record" ) @@ -31,13 +29,8 @@ func GatherPNCC(g *Gatherer, c chan<- gatherResult) { c <- gatherResult{errors: []error{err}} return } - gatherKubeClient, err := kubernetes.NewForConfig(g.gatherProtoKubeConfig) - if err != nil { - c <- gatherResult{errors: []error{err}} - return - } - records, errors := gatherPNCC(g.ctx, gatherDynamicClient, gatherKubeClient.CoreV1()) + records, errors := gatherPNCC(g.ctx, gatherDynamicClient) c <- gatherResult{records: records, errors: errors} } @@ -51,7 +44,7 @@ func getUnsuccessfulChecks(entries []controlplanev1.LogEntry) []controlplanev1.L return unsuccesseful } -func gatherPNCC(ctx context.Context, dynamicClient dynamic.Interface, coreClient corev1client.CoreV1Interface) ([]record.Record, []error) { +func gatherPNCC(ctx context.Context, dynamicClient dynamic.Interface) ([]record.Record, []error) { pnccListUnstruct, err := dynamicClient.Resource(pnccGroupVersionResource).List(ctx, metav1.ListOptions{}) if err != nil { return nil, []error{err}