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