-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apis/nfd: fix multiple matcher terms targeting the same feature #1468
apis/nfd: fix multiple matcher terms targeting the same feature #1468
Conversation
✅ Deploy Preview for kubernetes-sigs-nfd ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
/assign @ArangoGutierrez |
Fix NodeFeatureRule templating in cases where multiple matchFeatures terms are targeting the same feature. Previously, only matched feature elements from the last matcher terms were used as the input to the template. However, the input should contain all matched elements from all matcher terms. For example, consider the example rule snippet below: ... labelsTemplate: | {{ range .pci.device }}vendor.io/pci-device.{{ .class }}-{{ .device }}=exists {{ end }} matchFeatures: - feature: pci.device matchExpressions: class: {op: InRegexp, value: ["^03"]} vendor: {op: In, value: ["1234"]} - feature: pci.device matchExpressions: class: {op: InRegexp, value: ["^12"]} This rule matches if both a pci device of class 03 from vendor 1234 exists and a pci device of class 12 (from any vendor) exists. Previously, the template would only generate labels from the devices in class 12 (as that's the last term). With this patch the template creates device labels from devices in both classes 03 and 12.
d78cadb
to
63c2255
Compare
/retest |
1 similar comment
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
LGTM label has been added. Git tree hash: bd38d2acd37507e3bc0fb41cd7925b60621f1f36
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ArangoGutierrez, marquiz The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1468 +/- ##
==========================================
+ Coverage 30.55% 32.10% +1.54%
==========================================
Files 58 58
Lines 7527 7662 +135
==========================================
+ Hits 2300 2460 +160
+ Misses 4978 4937 -41
- Partials 249 265 +16
|
Fix NodeFeatureRule templating in cases where multiple matchFeatures terms are targeting the same feature. Previously, only matched feature elements from the last matcher terms were used as the input to the template. However, the input should contain all matched elements from all matcher terms.
For example, consider the example rule snippet below:
This rule matches if both a pci device of class
03
from vendor1234
exists and a pci device of class12
(from any vendor) exists. Previously, the template would only generate labels from the devices in class12
(as that's the last term). With this patch the template creates device labels from devices in both classes03
and12
.