diff options
| author | xiaojiangwang <wangxj0826@foxmail.com> | 2020-08-31 16:03:07 +0800 |
|---|---|---|
| committer | xiaojiangwang <wangxj0826@foxmail.com> | 2020-08-31 16:03:07 +0800 |
| commit | e1990475ecf20f6858742a962b22e5d00a269443 (patch) | |
| tree | 1c9f8ab462371fb4b9308c64fbf3ee328f5133f4 /edgemesh | |
| parent | Merge pull request #2081 from daixiang0/pr-comment (diff) | |
| download | kubeedge-e1990475ecf20f6858742a962b22e5d00a269443.tar.gz | |
add zero judgment when pods is obtained from the cache
Diffstat (limited to 'edgemesh')
| -rw-r--r-- | edgemesh/pkg/plugin/registry/registry.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/edgemesh/pkg/plugin/registry/registry.go b/edgemesh/pkg/plugin/registry/registry.go index 8c9074984..1916a62e6 100644 --- a/edgemesh/pkg/plugin/registry/registry.go +++ b/edgemesh/pkg/plugin/registry/registry.go @@ -187,6 +187,10 @@ func (esd *EdgeServiceDiscovery) getPods(name, namespace string) ([]v1.Pod, erro klog.Errorf("[EdgeMesh] pods %s from cache with invalid type", key) return nil, fmt.Errorf("pods %s from cache with invalid type", key) } + if len(pods) == 0 { + klog.Errorf("[EdgeMesh] pod list %s is empty", key) + return nil, fmt.Errorf("pod list %s is empty", key) + } klog.Infof("[EdgeMesh] get pods %s from cache", key) } else { // get from metaClient |
