Merge pull request #836 from wansir/fix-pod-filter
fix: filter pod by service name
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user