mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-15 04:57:56 +00:00
apis/nfd: fix templates with MatchAny only
Signed-off-by: Viktor Oreshkin <imselfish@stek29.rocks>
This commit is contained in:
parent
18c314df68
commit
88199edea8
1 changed files with 5 additions and 3 deletions
|
@ -50,11 +50,13 @@ func (r *Rule) Execute(features feature.Features) (RuleOutput, error) {
|
||||||
matched = true
|
matched = true
|
||||||
utils.KlogDump(4, "matches for matchAny "+r.Name, " ", matches)
|
utils.KlogDump(4, "matches for matchAny "+r.Name, " ", matches)
|
||||||
|
|
||||||
if r.labelsTemplate == nil {
|
if r.LabelsTemplate == "" && r.VarsTemplate == "" {
|
||||||
// No templating so we stop here (further matches would just
|
// there's no need to evaluate other matchers in MatchAny
|
||||||
// produce the same labels)
|
// if there are no templates to be executed on them - so
|
||||||
|
// short-circuit and stop on first match here
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := r.executeLabelsTemplate(matches, labels); err != nil {
|
if err := r.executeLabelsTemplate(matches, labels); err != nil {
|
||||||
return RuleOutput{}, err
|
return RuleOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue