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/pkg/apis/nfd/v1alpha1
Markus Lehtonen 36341bf4c7 apis/nfd: empty match expression set returns no features for templates
This patch changes a rare corner case of custom label rules with an
empty set of matchexpressions. The patch removes a special case where an
empty match expression set matched everything and returned all feature
elements for templates to consume. With this patch the match expression
set logically evaluates all expressions in the set and returns all
matches - if there are no expressions there are no matches and no
matched features are returned. However, the overall match result
(determining if "non-template" labels will be created) in this special
case will be "true" as before as none of the zero match expressions
failed.

The former behavior was somewhat illogical and counterintuitive: having
1 to N expressions matched and returned 1 to N features (at most), but,
having 0 expressions always matched everything and returned all
features. This was some leftover proof-of-concept functionality (for
some possible future extensions) that should have been removed before
merging.
2022-03-24 11:43:42 +02:00
..
doc.go pkg/apis/nfd/v1alpha1: document exported symbols 2021-12-01 10:46:56 +02:00
expression.go apis/nfd: empty match expression set returns no features for templates 2022-03-24 11:43:42 +02:00
expression_test.go apis/nfd: empty match expression set returns no features for templates 2022-03-24 11:43:42 +02:00
register.go pkg/apis/nfd/v1alpha1: document exported symbols 2021-12-01 10:46:56 +02:00
rule.go apis/nfd: empty match expression set returns no features for templates 2022-03-24 11:43:42 +02:00
rule_test.go apis/nfd: empty match expression set returns no features for templates 2022-03-24 11:43:42 +02:00
types.go pkg/apis/nfd/v1alpha1: document exported symbols 2021-12-01 10:46:56 +02:00
zz_generated.deepcopy.go pkg/apis/nfd: add variables to rule spec and support backreferences 2021-11-25 12:50:47 +02:00