1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-05 08:17:04 +00:00
node-feature-discovery/source
Markus Lehtonen 6cbed379df source/custom: implement matchAny directive
Implement a new 'matchAny' directive in the new rule format, building on
top of the previously implemented 'matchFeatures' matcher. MatchAny
applies a logical OR over multiple matchFeatures directives. That is, it
allows specifying multiple alternative matchers (at least one of which
must match) in a single label rule.

The configuration format for the new matchers is

  matchAny:
    - matchFeatures:
        - feature: <domain>.<feature>
          matchExpressions:
            <attribute>:
              op: <operator>
              value:
                - <list-of-values>
    - matchFeatures:
      ...

A configuration example. In order to require a cpu feature, kernel
module and one of two specific PCI devices (taking use of the shortform
notation):

  - name: multi-device-test
    labels:
      multi-device-feature: "true"
    matchFeatures:
      - feature: kernel.loadedmodule
        matchExpressions: [driver-module]
      - feature: cpu.cpuid
        matchExpressions: [AVX512F]
    matchAny:
      - matchFeatures:
          - feature; pci.device
            matchExpressions:
              vendor: "8086"
              device: "1234"
      - matchFeatures:
          - feature: pci.device
            matchExpressions:
              vendor: "8086"
              device: "abcd"
2021-11-12 16:51:30 +02:00
..
cpu source/cpu: implement FeatureSource 2021-11-11 18:33:40 +02:00
custom source/custom: implement matchAny directive 2021-11-12 16:51:30 +02:00
fake source: introduce FeatureSource interface 2021-09-20 09:58:07 +03:00
iommu source: introduce FeatureSource interface 2021-09-20 09:58:07 +03:00
kernel source/custom: move kernel module detection to source/kernel 2021-11-11 18:33:58 +02:00
local source/local: implement FeatureSource 2021-11-11 18:34:01 +02:00
memory source: introduce FeatureSource interface 2021-09-20 09:58:07 +03:00
network source: introduce FeatureSource interface 2021-09-20 09:58:07 +03:00
pci source/pci: implement FeatureSource 2021-11-11 18:33:53 +02:00
storage source: introduce FeatureSource interface 2021-09-20 09:58:07 +03:00
system source/system: implement FeatureSource 2021-11-11 18:33:58 +02:00
usb source/usb: implement FeatureSource 2021-11-11 18:33:53 +02:00
config.go topologyupdater: Bootstrap nfd-topology-updater in NFD 2021-09-21 10:47:39 +01:00
mock_LabelSource.go Merge pull request #602 from marquiz/devel/go-generate 2021-09-21 06:16:24 -07:00
source.go Merge pull request #602 from marquiz/devel/go-generate 2021-09-21 06:16:24 -07:00
source_test.go source/kernel: implement FeatureSource 2021-11-11 18:33:40 +02:00