Fix after merge

This commit is contained in:
Jake Sanders 2019-12-17 16:27:17 +00:00
parent 34b1c403bb
commit c3607c23e7
2 changed files with 5 additions and 4 deletions

View File

@ -13,10 +13,10 @@ func (k *klog) Write(l log.Record) {
write(l) write(l)
} }
func (k *klog) Stream(stop chan bool) <-chan log.Record { func (k *klog) Stream() (<-chan log.Record, chan bool) {
c := make(chan log.Record) c, s := make(chan log.Record), make(chan bool)
go close(c) go close(c)
return c return c, s
} }
// New returns a configured Kubernetes logger // New returns a configured Kubernetes logger

View File

@ -41,11 +41,12 @@ func TestKubernetes(t *testing.T) {
assert.Nil(t, k.Read(), "Read should be unimplemented") assert.Nil(t, k.Read(), "Read should be unimplemented")
stream := k.Stream(make(chan bool)) stream, stop := k.Stream()
records := []log.Record{} records := []log.Record{}
for s := range stream { for s := range stream {
records = append(records, s) records = append(records, s)
} }
close(stop)
assert.Equal(t, 0, len(records), "Stream should be unimplemented") assert.Equal(t, 0, len(records), "Stream should be unimplemented")
} }