未验证 提交 fcd8d8ee 编写于 作者: H hongming

fix: filter pod by service name

Signed-off-by: Nhongming <talonwan@yunify.com>
上级 d2b1bf4b
......@@ -140,7 +140,7 @@ func podBelongToService(item *v1.Pod, serviceName string) bool {
}
selector := labels.Set(service.Spec.Selector).AsSelectorPreValidated()
if !selector.Matches(labels.Set(item.Labels)) {
if selector.Empty() || !selector.Matches(labels.Set(item.Labels)) {
return false
}
return true
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册