1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-28 10:47:23 +00:00
node-feature-discovery/pkg
Markus Lehtonen 63c22551df apis/nfd: fix multiple matcher terms targeting the same feature
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.
2023-11-22 10:43:52 +02:00
..
apihelper generate: bump tools to their latest versions 2023-07-27 14:29:48 +03:00
apis/nfd/v1alpha1 apis/nfd: fix multiple matcher terms targeting the same feature 2023-11-22 10:43:52 +02:00
cpuid pkg/cpuid: lint fixes 2020-05-20 21:48:06 +03:00
generated generate: update auto-generated code 2023-04-19 09:49:17 +03:00
labeler generate: bump tools to their latest versions 2023-07-27 14:29:48 +03:00
nfd-gc nfd-gc: add metrics 2023-10-09 13:39:28 +00:00
nfd-master Discover node features as annotations 2023-10-25 19:58:58 +02:00
nfd-topology-updater Refactor metrics 2023-10-09 10:49:12 +03:00
nfd-worker Refactor metrics 2023-10-09 10:49:12 +03:00
podres generate: bump tools to their latest versions 2023-07-27 14:29:48 +03:00
resourcemonitor topology-updater: migrate to structured logging 2023-05-31 14:43:08 +03:00
topologypolicy nrt-api: move from v1alpha1 to v1alpha2 2023-02-09 12:29:54 +01:00
utils Refactor metrics 2023-10-09 10:49:12 +03:00
version version: allow undefined version 2020-03-20 07:21:43 +02:00