@@ -97,6 +97,7 @@ func (nv *nodeValidator) Execute(ctx context.Context) ([]*CompatibilityStatus, e
97
97
}
98
98
99
99
func evaluateRuleStatus (rule * nfdv1alpha1.Rule , matchStatus * nodefeaturerule.MatchStatus ) ProcessedRuleStatus {
100
+ var matchedFeatureTerms nfdv1alpha1.FeatureMatcher
100
101
out := ProcessedRuleStatus {Name : rule .Name , IsMatch : matchStatus .IsMatch }
101
102
102
103
evaluateFeatureMatcher := func (featureMatcher , matchedFeatureTerms nfdv1alpha1.FeatureMatcher ) []MatchedExpression {
@@ -163,11 +164,17 @@ func evaluateRuleStatus(rule *nfdv1alpha1.Rule, matchStatus *nodefeaturerule.Mat
163
164
}
164
165
165
166
if matchFeatures := rule .MatchFeatures ; matchFeatures != nil {
166
- out .MatchedExpressions = evaluateFeatureMatcher (matchFeatures , matchStatus .MatchedFeaturesTerms )
167
+ if matchStatus .MatchFeatureStatus != nil {
168
+ matchedFeatureTerms = matchStatus .MatchFeatureStatus .MatchedFeaturesTerms
169
+ }
170
+ out .MatchedExpressions = evaluateFeatureMatcher (matchFeatures , matchedFeatureTerms )
167
171
}
168
172
169
173
for i , matchAnyElem := range rule .MatchAny {
170
- matchedExpressions := evaluateFeatureMatcher (matchAnyElem .MatchFeatures , matchStatus .MatchAny [i ].MatchedFeaturesTerms )
174
+ if matchStatus .MatchAny [i ].MatchedFeaturesTerms != nil {
175
+ matchedFeatureTerms = matchStatus .MatchAny [i ].MatchedFeaturesTerms
176
+ }
177
+ matchedExpressions := evaluateFeatureMatcher (matchAnyElem .MatchFeatures , matchedFeatureTerms )
171
178
out .MatchedAny = append (out .MatchedAny , MatchAnyElem {MatchedExpressions : matchedExpressions })
172
179
}
173
180
0 commit comments