Skip to content

Commit edaf512

Browse files
author
Marcell Sevcsik
committed
Adjust new gatherings
1 parent 4ca4023 commit edaf512

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

pkg/gather/clusterconfig/openshift_apiserver_operator_logs.go

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package clusterconfig
22

33
import (
44
"k8s.io/client-go/kubernetes"
5-
6-
"github.com/openshift/insights-operator/pkg/record"
75
)
86

97
// GatherOpenShiftAPIServerOperatorLogs collects logs from openshift-apiserver-operator with following substrings:

pkg/gather/clusterconfig/openshift_sdn_logs.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package clusterconfig
22

33
import (
44
"k8s.io/client-go/kubernetes"
5-
6-
"github.com/openshift/insights-operator/pkg/record"
75
)
86

97
// GatherOpenshiftSDNLogs collects logs from pods in openshift-sdn namespace with following substrings:
@@ -16,7 +14,8 @@ import (
1614
// Response see https://docs.openshift.com/container-platform/4.6/rest_api/workloads_apis/pod-core-v1.html#apiv1namespacesnamespacepodsnamelog
1715
//
1816
// Location in archive: config/pod/openshift-sdn/logs/{pod-name}/errors.log
19-
func GatherOpenshiftSDNLogs(g *Gatherer) ([]record.Record, []error) {
17+
func GatherOpenshiftSDNLogs(g *Gatherer, c chan<- gatherResult) {
18+
defer close(c)
2019
messagesToSearch := []string{
2120
"Got OnEndpointsUpdate for unknown Endpoints",
2221
"Got OnEndpointsDelete for unknown Endpoints",
@@ -26,7 +25,8 @@ func GatherOpenshiftSDNLogs(g *Gatherer) ([]record.Record, []error) {
2625

2726
gatherKubeClient, err := kubernetes.NewForConfig(g.gatherProtoKubeConfig)
2827
if err != nil {
29-
return nil, []error{err}
28+
c <- gatherResult{nil, []error{err}}
29+
return
3030
}
3131

3232
coreClient := gatherKubeClient.CoreV1()
@@ -42,8 +42,9 @@ func GatherOpenshiftSDNLogs(g *Gatherer) ([]record.Record, []error) {
4242
"app=sdn",
4343
)
4444
if err != nil {
45-
return nil, []error{err}
45+
c <- gatherResult{nil, []error{err}}
46+
return
4647
}
4748

48-
return records, nil
49+
c <- gatherResult{records, nil}
4950
}

0 commit comments

Comments
 (0)