runtime/kubernetes: fix streaming logs error handling (#1919)

This commit is contained in:
ben-toogood 2020-08-10 15:20:33 +01:00 committed by GitHub
parent fdce953c15
commit 593b543230
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,6 +165,9 @@ func (k *klog) Stream() (runtime.LogStream, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
if len(pods) == 0 {
return nil, errors.NotFound("runtime.logs", "no such service")
}
stream := &kubeStream{ stream := &kubeStream{
stream: make(chan runtime.LogRecord), stream: make(chan runtime.LogRecord),