1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-07 01:07:05 +00:00
Commit graph

18 commits

Author SHA1 Message Date
Marcin Franczyk
efc86e91a2 Bugfix: handle matchAny and matchFeatures when they appear in one spec
Signed-off-by: Marcin Franczyk <marcin0franczyk@gmail.com>
2025-03-03 11:52:37 +01:00
Fahrzin Hemmati
b0dbd11af7 Use Sprig template functions and add asLabelValue function 2025-02-19 01:51:32 -08:00
Marcin Franczyk
8db03fe0f8
Add unit tests for invalid feature in the compatibility spec
Signed-off-by: Marcin Franczyk <marcin0franczyk@gmail.com>
2025-01-09 10:16:34 +01:00
Marcin Franczyk
60b8a2136a
Allow for rule processing in case of a missing feature
Signed-off-by: Marcin Franczyk <marcin0franczyk@gmail.com>
2025-01-08 13:58:03 +01:00
Markus Lehtonen
97345a4a96
Merge branch 'master' into feat/skip-nodes 2024-12-20 10:38:44 +02:00
Kavin
6b0352a190 Remove error logs for nodes without nodefeatures 2024-12-18 23:27:26 +05:30
Marcin Franczyk
51bbbe202d Extend NFR code with MatchStatus and introduce failFast strategy.
MatchStatus provides details about successful expressions and their results,
which are the matched host features. Additionally, a new flag controls
rule processing behavior: it can either stop at the first error or
continue processing all expressions and rules.

Signed-off-by: Marcin Franczyk <marcin0franczyk@gmail.com>
2024-12-18 10:48:14 +01:00
Markus Lehtonen
b5b701fbbf Simplify code
Drop unnecessry typedefs.
2024-07-09 09:05:33 +03:00
Kubernetes Prow Robot
814255b7f1
Merge pull request #1671 from marquiz/devel/nfd-api-multi-type-feature
apis/nfd: allow different types of features of the same name
2024-05-24 03:42:30 -07:00
Markus Lehtonen
3b448ae623 apis/nfd: allow different types of features of the same name
This patch changes the handling of NodeFeatureRules so that one feature
name (say "cpu.cpuid") can hold different types of features (flags,
attributes and/or instances). Requiring features to choose one single
type has not been a limitation of the API itself (and there has been no
validation on this) but an implementation decision.

The new evalutation logic of match expressions is such that "flags" and
"attributes" are basically evaluated as an union - they are both maps
but "flags" just don't have any value associated with the key. However,
"instances" are handled separately as that is basically an array of
maps and needs to be evaluated in a different way (loop over the array
of instances and evaluate expressions against the attributes of each).
Because of this difference care must be taken if mixing "instance"
features with "flag" and/or "attribute" features.

Note that the API types or their validation is not changed - just the
implementation of how the NodeFeatureRules are evaluated.
2024-05-24 13:18:31 +03:00
Carlos Eduardo Arango Gutierrez
47c054e1db
Add NodeFeatureGroup CRD
The NodeFeatureGroup is an NFD-specific custom resource that is designed for
grouping nodes based on their features. NFD-Master watches for NodeFeatureGroup
objects in the cluster and updates the status of the NodeFeatureGroup object
with the list of nodes that match the feature group rules. The NodeFeatureGroup
rules follow the same syntax as the NodeFeatureRule rules.

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
2024-05-23 16:34:08 +02:00
Markus Lehtonen
bad7d1fcb1 apis/nfd: increase unit test coverage
Cover error cases of the "match name" functions.
2024-04-30 16:02:13 +03:00
Kubernetes Prow Robot
ca13b4903d
Merge pull request #1669 from marquiz/devel/nfd-api-helpers-refactor
api/nfd: use varargs in the NewInstanceFeatures helper
2024-04-23 06:33:46 -07:00
Kubernetes Prow Robot
be44447dc0
Merge pull request #1670 from marquiz/devel/flag-feature-errors
apis/nfd: no error on ops that never match
2024-04-23 06:09:06 -07:00
Markus Lehtonen
fbb7303562 apis/nfd: no error on ops that never match
Return false (i.e. "did not match") but no error when evaluating a match
expression against a "flag" type feature (which don't have any
associated value, just the name) if a MatchOp that never matches is
used.

This is preparation for supporting multi-type features, i.e. one
feature, like "cpu.cpuid", having e.g. "flag" and "attribute" type
features.
2024-04-23 11:07:49 +03:00
Markus Lehtonen
719c5186f6 api/nfd: use varargs in the NewInstanceFeatures helper
Make usage of this helper function more flexible.
2024-04-23 10:29:24 +03:00
Markus Lehtonen
6b1e9c7860 apis/nfd: add unit tests for match name functions 2024-04-22 17:20:33 +03:00
Carlos Eduardo Arango Gutierrez
3434557d7c
Move NFD api to a separate go mod
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
2024-04-05 16:35:47 +02:00