Don't close the stream (#1844)
This commit is contained in:
parent
68927e875b
commit
7d41c2224e
@ -392,7 +392,6 @@ func (k *kubeStream) Stop() error {
|
|||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
close(k.stop)
|
close(k.stop)
|
||||||
close(k.stream)
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,11 @@ func (k *klog) podLogStream(podName string, stream *kubeStream) error {
|
|||||||
record := runtime.LogRecord{
|
record := runtime.LogRecord{
|
||||||
Message: s.Text(),
|
Message: s.Text(),
|
||||||
}
|
}
|
||||||
stream.stream <- record
|
select {
|
||||||
|
case stream.stream <- record:
|
||||||
|
case <-stream.stop:
|
||||||
|
return stream.Error()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO: is there a blocking call
|
// TODO: is there a blocking call
|
||||||
// rather than a sleep loop?
|
// rather than a sleep loop?
|
||||||
|
Loading…
Reference in New Issue
Block a user