1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-05 16:27:05 +00:00
node-feature-discovery/test/e2e/data
Markus Lehtonen fe412a54b9 apis/nfd: add matchName field in feature matcher terms
Extend the format of feature matcher terms (the elements of the
arrayspecified under under matchFeatures field) with new matchName
field. The value of this field is an expression that is evaluated
against the names of feature elements instead of their values (values
are matched with the matchExpressions field, instead).

The matchName field is useful e.g. in template rules for creating
per-feature-element labels based on feature names (instead of values)
and in non-template rules for checking if (at least) one of certain
feature element names are present.

If both matchExpressions and matchName for certain feature matcher term
is specified, they both must match in order to get an overall match.
Also, in this case the list of matched features (used in templating) is
the union of the results from matchExpressions and matchName.

An example of creating an "avx512" label if any AVX512* CPUID feature is
present:

  - name: "avx wildcard rule"
    labels:
        avx512: "true"
    matchFeatures:
      - feature: cpu.cpuid
        matchName: {op: InRegexp, value: ["^AVX512"]}

An example of a template rule creating a dynamic set of labels  based on
the existence of certain kconfig options.

  - name: "kconfig template rule"
    labelsTemplate: |
      {{ range .kernel.config }}kconfig-{{ .Name }}={{ .Value }}
      {{ end }}
    matchFeatures:
      - feature: kernel.config
        matchName: {op: In, value: ["SWAP", "X86", "ARM"]}

NOTE: this patch changes the corner case of nil/null match expressions
with instance features (i.e. "matchExpressions: null"). Previously, we
returned all instances for templating but now a nil match expression is
not evaluated and no instances for templating are returned.
2023-12-15 11:32:23 +02:00
..
nodefeature-1.yaml nfd-master: predictable handling of unprefixed names 2023-11-23 22:16:04 +02:00
nodefeature-2.yaml test/e2e: more comprehensive test for NodeFeature objects 2023-01-03 17:50:48 +02:00
nodefeature-3.yaml test: implement e2e test of the deny-label-ns flag 2023-03-10 11:11:36 +01:00
nodefeaturerule-1.yaml apis/nfd: add matchName field in feature matcher terms 2023-12-15 11:32:23 +02:00
nodefeaturerule-2.yaml apis/nfd: add matchName field in feature matcher terms 2023-12-15 11:32:23 +02:00
nodefeaturerule-3-updated.yaml nfd-master: disallow unprefixed and kubernetes taints 2023-04-06 16:12:37 +03:00
nodefeaturerule-3.yaml nfd-master: disallow unprefixed and kubernetes taints 2023-04-06 16:12:37 +03:00
nodefeaturerule-4.yaml nfd-master: fix filtering of extended resources 2023-09-27 10:55:11 +03:00
nodefeaturerule-5.yaml Discover node features as annotations 2023-10-25 19:58:58 +02:00