Skip to content

Commit 81eacb7

Browse files
author
Marcell Sevcsik
committed
Rebase adjustments
1 parent 2611b6a commit 81eacb7

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

pkg/controller/periodic/periodic.go

-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ type Controller struct {
2929
statuses map[string]*controllerstatus.Simple
3030

3131
initialDelay time.Duration
32-
3332
}
3433

3534
func New(configurator Configurator, recorder record.FlushInterface, gatherers map[string]gather.Interface) *Controller {
@@ -59,7 +58,6 @@ func (c *Controller) Sources() []controllerstatus.Interface {
5958
return sources
6059
}
6160

62-
6361
func (c *Controller) Run(stopCh <-chan struct{}, initialDelay time.Duration) {
6462
defer utilruntime.HandleCrash()
6563
defer klog.Info("Shutting down")
@@ -84,7 +82,6 @@ func (c *Controller) Gather() {
8482
}
8583
}
8684

87-
8885
func (c *Controller) runGatherer(name string) error {
8986
gatherer, ok := c.gatherers[name]
9087
if !ok {

pkg/gather/clusterconfig/0_gatherer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (g *Gatherer) Gather(ctx context.Context, gatherList []string, recorder rec
143143
return nil
144144
}
145145

146-
func (g *Gatherer) startGathering(gatherList []string, errors* []string) ([]reflect.SelectCase, []time.Time, error) {
146+
func (g *Gatherer) startGathering(gatherList []string, errors *[]string) ([]reflect.SelectCase, []time.Time, error) {
147147
var cases []reflect.SelectCase
148148
var starts []time.Time
149149
// Starts the gathers in Go routines

pkg/gather/clusterconfig/openshift_apiserver_operator_logs.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,28 @@ import (
2424
// Response see https://docs.openshift.com/container-platform/4.6/rest_api/workloads_apis/pod-core-v1.html#apiv1namespacesnamespacepodsnamelog
2525
//
2626
// Location in archive: config/pod/{namespace-name}/logs/{pod-name}/errors.log
27-
func GatherOpenShiftAPIServerOperatorLogs(g *Gatherer) ([]record.Record, []error) {
27+
func GatherOpenShiftAPIServerOperatorLogs(g *Gatherer, ch chan<- gatherResult) {
28+
defer close(ch)
2829
messagesToSearch := []string{
2930
"the server has received too many requests and has asked us",
3031
"because serving request timed out and response had been started",
3132
}
3233

3334
gatherKubeClient, err := kubernetes.NewForConfig(g.gatherProtoKubeConfig)
3435
if err != nil {
35-
return nil, []error{err}
36+
ch <- gatherResult{nil, []error{err}}
37+
return
3638
}
3739

3840
client := gatherKubeClient.CoreV1()
3941

4042
records, err := gatherOpenShiftAPIServerOperatorLastDayLogs(g.ctx, client, messagesToSearch)
4143
if err != nil {
42-
return nil, []error{err}
44+
ch <- gatherResult{nil, []error{err}}
45+
return
4346
}
4447

45-
return records, nil
48+
ch <- gatherResult{records, nil}
4649
}
4750

4851
func gatherOpenShiftAPIServerOperatorLastDayLogs(

0 commit comments

Comments
 (0)