logs should return for non existent services (#1906)
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/micro/go-micro/v3/errors"
|
||||
"github.com/micro/go-micro/v3/runtime"
|
||||
"github.com/micro/go-micro/v3/util/kubernetes/client"
|
||||
"github.com/micro/go-micro/v3/util/log"
|
||||
@@ -105,6 +106,9 @@ func (k *klog) Read() ([]runtime.LogRecord, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(pods) == 0 {
|
||||
return nil, errors.NotFound("runtime.logs", "no such service")
|
||||
}
|
||||
|
||||
var records []runtime.LogRecord
|
||||
|
||||
|
Reference in New Issue
Block a user