1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00
node-feature-discovery/docs
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
..
_includes/templates docs: update jekyll-rdt-theme to v2.0.10 2021-10-11 11:26:37 +03:00
contributing docs: restructure docs 2022-11-03 10:26:56 +02:00
deployment deployment/kustomize: drop default-combined overlay 2023-12-08 14:42:31 +02:00
developer-guide Merge pull request #1489 from ArangoGutierrez/ginkofocus 2023-12-08 18:24:20 +01:00
get-started docs: streamline language 2023-12-01 15:57:53 +02:00
reference Create a Validate pkg 2023-12-11 16:54:22 +01:00
usage apis/nfd: add matchName field in feature matcher terms 2023-12-15 11:32:23 +02:00
.gitignore docs: initial site setup 2020-10-08 10:50:04 +03:00
404.html docs: initial site setup 2020-10-08 10:50:04 +03:00
_config.yml docs: update github-pages gem to v227 2022-11-16 21:08:13 +02:00
Gemfile docs: update docs build dependencies 2023-08-30 19:31:35 +03:00
Gemfile.lock docs: update docs build dependencies 2023-08-30 19:31:35 +03:00
index.html docs: add landing page and quick-start guide 2020-10-29 13:29:10 +02:00
mdl-style.rb Make mdlint v0.13 happy 2023-10-25 21:21:11 +02:00