Skip to content

Commit 05987d1

Browse files
authored
Merge pull request #2199 from mfranczy/bugfix-image-compatibility
Bugfix: NFR and NFG rules processing
2 parents 0a8e5f7 + a6f8e11 commit 05987d1

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

pkg/apis/nfd/nodefeaturerule/rule.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func Execute(r *nfdv1alpha1.Rule, features *nfdv1alpha1.Features, failFast bool)
133133

134134
maps.Copy(labels, r.Labels)
135135
maps.Copy(vars, r.Vars)
136-
matchStatus.IsMatch = true
136+
matchStatus.IsMatch = isMatch
137137

138138
ret := RuleOutput{
139139
Labels: labels,
@@ -204,7 +204,7 @@ func ExecuteGroupRule(r *nfdv1alpha1.GroupRule, features *nfdv1alpha1.Features,
204204
}
205205

206206
maps.Copy(vars, r.Vars)
207-
matchStatus.IsMatch = true
207+
matchStatus.IsMatch = isMatch
208208

209209
ret := GroupRuleOutput{
210210
Vars: vars,

pkg/client-nfd/compat/node-validator/node-validator_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,12 @@ func TestNodeValidator(t *testing.T) {
334334
"name": &v1alpha1.MatchExpression{Op: v1alpha1.MatchIn, Value: v1alpha1.MatchValue{"instance_unknown"}},
335335
},
336336
},
337+
{
338+
Feature: "fake.instance",
339+
MatchExpressions: &v1alpha1.MatchExpressionSet{
340+
"name": &v1alpha1.MatchExpression{Op: v1alpha1.MatchIn, Value: v1alpha1.MatchValue{"instance_1"}},
341+
},
342+
},
337343
},
338344
},
339345
},
@@ -366,6 +372,13 @@ func TestNodeValidator(t *testing.T) {
366372
},
367373
{
368374
MatchedExpressions: []MatchedExpression{
375+
{
376+
Feature: "fake.instance",
377+
Name: "name",
378+
Expression: &v1alpha1.MatchExpression{Op: v1alpha1.MatchIn, Value: v1alpha1.MatchValue{"instance_1"}},
379+
MatcherType: MatchExpressionType,
380+
IsMatch: true,
381+
},
369382
{
370383
Feature: "fake.instance",
371384
Name: "name",

0 commit comments

Comments
 (0)