not finding a label is not an error
@@ -321,8 +321,11 @@ func nodeMatchesFilters(node corev1.Node, filters *troubleshootv1beta2.NodeResou
// all filters must pass for this to pass
if filters.Selector != nil {
for k, v := range filters.Selector.MatchLabel {
- if l, found := node.Labels[k]; !found || l != v {
- return false, errors.Errorf("failed to match label %s", k)
+ l, found := node.Labels[k]
+ if !found {
+ return false, nil
+ } else if l != v {
+ return false, nil
}
}
}
