@@ -97,6 +97,7 @@ func (nv *nodeValidator) Execute(ctx context.Context) ([]*CompatibilityStatus, e
9797}
9898
9999func evaluateRuleStatus (rule * nfdv1alpha1.Rule , matchStatus * nodefeaturerule.MatchStatus ) ProcessedRuleStatus {
100+ var matchedFeatureTerms nfdv1alpha1.FeatureMatcher
100101 out := ProcessedRuleStatus {Name : rule .Name , IsMatch : matchStatus .IsMatch }
101102
102103 evaluateFeatureMatcher := func (featureMatcher , matchedFeatureTerms nfdv1alpha1.FeatureMatcher ) []MatchedExpression {
@@ -163,11 +164,17 @@ func evaluateRuleStatus(rule *nfdv1alpha1.Rule, matchStatus *nodefeaturerule.Mat
163164 }
164165
165166 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 )
167171 }
168172
169173 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 )
171178 out .MatchedAny = append (out .MatchedAny , MatchAnyElem {MatchedExpressions : matchedExpressions })
172179 }
173180
0 commit comments