diff --git a/pkg/apis/nfd/nodefeaturerule/rule.go b/pkg/apis/nfd/nodefeaturerule/rule.go index 98629497a..9289eaa12 100644 --- a/pkg/apis/nfd/nodefeaturerule/rule.go +++ b/pkg/apis/nfd/nodefeaturerule/rule.go @@ -268,10 +268,11 @@ func evaluateFeatureMatcher(m *nfdv1alpha1.FeatureMatcher, features *nfdv1alpha1 fA, okA := features.Attributes[featureName] fI, okI := features.Instances[featureName] if !okF && !okA && !okI { + klog.V(2).InfoS("feature not available", "featureName", featureName) if failFast { - klog.V(2).InfoS("feature not available", "featureName", featureName) return false, nil, nil } + isMatch = false continue } diff --git a/pkg/client-nfd/compat/node-validator/node-validator_test.go b/pkg/client-nfd/compat/node-validator/node-validator_test.go index 6977578a9..c0cbdaf5c 100644 --- a/pkg/client-nfd/compat/node-validator/node-validator_test.go +++ b/pkg/client-nfd/compat/node-validator/node-validator_test.go @@ -114,6 +114,17 @@ func TestNodeValidator(t *testing.T) { }, }, }, + { + Name: "fake_5", + MatchFeatures: v1alpha1.FeatureMatcher{ + { + Feature: "unknown.unknown", + MatchExpressions: &v1alpha1.MatchExpressionSet{ + "name": &v1alpha1.MatchExpression{Op: v1alpha1.MatchIn, Value: v1alpha1.MatchValue{"instance_1"}}, + }, + }, + }, + }, }, }, }, @@ -219,6 +230,19 @@ func TestNodeValidator(t *testing.T) { }, }, }, + { + Name: "fake_5", + IsMatch: false, + MatchedExpressions: []MatchedExpression{ + { + Feature: "unknown.unknown", + Name: "name", + Expression: &v1alpha1.MatchExpression{Op: v1alpha1.MatchIn, Value: v1alpha1.MatchValue{"instance_1"}}, + MatcherType: MatchExpressionType, + IsMatch: false, + }, + }, + }, }, }, }