Merge pull request #84957 from ZP-AlwaysWin/dev-1105-1

Remove unnecessary judgment
This commit is contained in:
Kubernetes Prow Robot
2019-11-12 04:48:43 -08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -67,7 +67,7 @@ func FilterPodsByNamespace(pods []*v1.Pod, ns string) []*v1.Pod {
// CreateSelectorFromLabels is used to define a selector that corresponds to the keys in a map.
func CreateSelectorFromLabels(aL map[string]string) labels.Selector {
if aL == nil || len(aL) == 0 {
if len(aL) == 0 {
return labels.Everything()
}
return labels.Set(aL).AsSelector()