1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-15 17:50:49 +00:00
Commit graph

2108 commits

Author SHA1 Message Date
Kubernetes Prow Robot
dfef0ebe4a
Merge pull request #1472 from marquiz/devel/typo-fix
nfd-worker: fix typo in log message
2023-11-24 16:53:49 +01:00
Kubernetes Prow Robot
e0307301f6
Merge pull request #1474 from marquiz/devel/api-unit-tests
Use T.Run in expression unit tests
2023-11-24 16:32:04 +01:00
Markus Lehtonen
f266533a7d nfd-worker: fix typo in log message 2023-11-24 17:17:42 +02:00
Markus Lehtonen
f6c360188e Use T.Run in expression unit tests
The "better way" of running test cases, get e.g. better output in case
of errors.

Also drop some unneeded type definitions from the tests.
2023-11-24 17:14:12 +02:00
Kubernetes Prow Robot
ec9d649654
Merge pull request #1473 from marquiz/devel/fix-api-unit-test
Reproducible output from expression matching
2023-11-24 16:12:30 +01:00
Markus Lehtonen
f489ca98b5 Reproducible output from expression matching
Fix flakyness of unit tests by adding back the sorting of matched
feature elements that was unadvisedly removed in
63c22551df. This might help debugging some
corner cases in real-life scenarios (when using templating), too.
2023-11-24 16:27:38 +02:00
Kubernetes Prow Robot
ed8898de6a
Merge pull request #1461 from marquiz/devel/no-implicit-ns
Option to stop implicitly adding default prefix to names
2023-11-24 14:53:09 +01:00
Kubernetes Prow Robot
7154458524
Merge pull request #1468 from marquiz/devel/nfr-template-fix
apis/nfd: fix multiple matcher terms targeting the same feature
2023-11-24 13:20:49 +01:00
Markus Lehtonen
1d012a28cd Option to stop implicitly adding default prefix to names
Add new autoDefaultNs (default is "true") config option to nfd-master.
Setting the config option to false stops NFD from automatically adding
the "feature.node.kubernetes.io/" prefix to labels, annotations and
extended resources. Taints are not affected as for them no prefix is
automatically added. The user-visible part of enabling the option change
is that NodeFeatureRules, local feature files, hooks and configuration
of the "custom" may need to be altereda (if the auto-prefixing is
relied on).

For now, the config option defaults to "true", meaning no change in
default behavior. However, the intent is to change the default to
"false" in a future release, deprecating the option and eventually
removing it (forcing it to "false").

The goal of stopping doing "auto-prefixing" is to simplify the operation
(of nfd and users). Make the naming more straightforward and easier to
understand and debug (kind of WYSIWYG), eliminating peculiar corner
cases:

1. Make validation simpler and unambiguous
2. Remove "overloading" of names, i.e. the mapping two values to the
   same actual name. E.g. previously something like

      labels:
        feature.node.kubernetes.io/foo: bar
        foo: baz

   Could actually result in node label:

     feature.node.kubernetes.io/foo: baz

3. Make the processing/usagee of the "rule.matched" and "local.labels"
   feature in NodeFeatureRules unambiguous and more understadable. E.g.
   previously you could have node label
   "feature.node.kubernetes.io/local-foo: bar" but in the NodeFeatureRule
   you'd need to use the unprefixed name "local-foo" or the fully
   prefixed name, depending on what was specified in the feature file (or
   hook) on the node(s).

NOTE: setting autoDefaultNs to false is a breaking change for users who
rely on automatic prefixing with the default feature.node.kubernetes.io/
namespace. NodeFeatureRules, feature files, hooks and custom rules
(configuration of the "custom" source of nfd-worker) will need to be
altered.  Unprefixed labels, annoations and extended resources will be
denied by nfd-master.
2023-11-24 12:48:20 +02:00
Kubernetes Prow Robot
4e7f8b10be
Merge pull request #1471 from marquiz/devel/default-ns-fix
nfd-master: predictable handling of unprefixed names
2023-11-24 11:33:21 +01:00
Kubernetes Prow Robot
1497cc69a0
Merge pull request #1470 from marquiz/devel/nfd-master-refactor
nfd-master: drop stale variables
2023-11-24 11:09:07 +01:00
Markus Lehtonen
dc5af8be04 nfd-master: predictable handling of unprefixed names
Make the handling of unprefixed names (of labels, annotations and
extended resources) well-defined and predictable. Previously the
resulting output was not predictable in case the same name was coming in
both the unprefixed and prefixed form, say unprefixed "foo=bar" coming from
one source (be it nfd-worker or NodeFeature(Rule)) and
"feature.node.kubernetes.io/foo=baz" from a NodeFeature(Rule).
Previously the output value was randomly either "bar" or "baz".

This patch adds prefixes to all names early in the processing
"pipeline", preventing random name clashes later on.
2023-11-23 22:16:04 +02:00
Markus Lehtonen
678d7e89cb nfd-master: drop stale variables
Remove some stale variables that were leftover from the recent removal
of nfd version annotations.
2023-11-23 19:01:22 +02:00
Kubernetes Prow Robot
38ed148352
Merge pull request #1469 from marquiz/devel/fix-docs
docs: fix small typo in customization guide
2023-11-22 15:51:16 +01:00
Markus Lehtonen
36e431dd54 docs: fix small typo in customization guide 2023-11-22 10:45:45 +02:00
Markus Lehtonen
63c22551df apis/nfd: fix multiple matcher terms targeting the same feature
Fix NodeFeatureRule templating in cases where multiple matchFeatures
terms are targeting the same feature. Previously, only matched feature
elements from the last matcher terms were used as the input to the
template. However, the input should contain all matched elements from
all matcher terms.

For example, consider the example rule snippet below:

  ...
  labelsTemplate: |
    {{ range .pci.device }}vendor.io/pci-device.{{ .class }}-{{ .device }}=exists
    {{ end }}
  matchFeatures:
    - feature: pci.device
      matchExpressions:
        class: {op: InRegexp, value: ["^03"]}
        vendor: {op: In, value: ["1234"]}
    - feature: pci.device
      matchExpressions:
        class: {op: InRegexp, value: ["^12"]}

This rule matches if both a pci device of class 03 from vendor 1234
exists and a pci device of class 12 (from any vendor) exists.
Previously, the template would only generate labels from the devices in
class 12 (as that's the last term). With this patch the template creates
device labels from devices in both classes 03 and 12.
2023-11-22 10:43:52 +02:00
Kubernetes Prow Robot
62870968cd
Merge pull request #1460 from marquiz/devel/e2e-timeout
test/e2e: increase timeout for waiting node status
2023-11-21 12:05:05 +01:00
Kubernetes Prow Robot
371ed3ff21
Merge pull request #1458 from marquiz/devel/logging-fix
apis/nfd: fix logging of rule expression processing
2023-11-21 12:04:59 +01:00
Kubernetes Prow Robot
74c5780289
Merge pull request #1467 from marquiz/devel/api-comments
apis/nfd: fix incorrect comments of matching functions
2023-11-20 10:54:51 +01:00
Markus Lehtonen
9cbe742bfb apis/nfd: fix incorrect comments of matching functions
This patch updates the comments to correspond to the actual behavior
which was changed back in 36341bf4c7.
2023-11-20 10:11:35 +02:00
Kubernetes Prow Robot
c588371726
Merge pull request #1465 from marquiz/devel/deps
go.mod: bump kubernetes to v1.28.4
2023-11-16 12:45:33 +01:00
Markus Lehtonen
18fada0cfb test/e2e: increase timeout for waiting node status
In some occasions the node status (capacity) takes a lot of time to
update. Increase the timeout on extended resource tests. Revert the default
timeout back to 10s.
2023-11-16 13:26:09 +02:00
Markus Lehtonen
ffacd1535b go.mod: bump kubernetes to v1.28.4 2023-11-16 10:08:39 +02:00
Kubernetes Prow Robot
15f33c926e
Merge pull request #1463 from marquiz/devel/deps
go.mod: update deps
2023-11-14 17:35:50 +01:00
Markus Lehtonen
593d19dfce go.mod: update deps 2023-11-14 18:09:52 +02:00
Kubernetes Prow Robot
fa081ef125
Merge pull request #1457 from marquiz/devel/deps
go.mod: update deps
2023-11-11 15:12:42 +01:00
Markus Lehtonen
c1a819d29a go.mod: update deps 2023-11-10 12:57:19 +02:00
Markus Lehtonen
8ec55fe8db apis/nfd: fix logging of rule expression processing 2023-11-10 09:40:54 +02:00
AhmedGrati
6aa6590665 docs: add network.virtual in customization guide
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-11-09 16:44:30 +01:00
Kubernetes Prow Robot
9527b69972
Merge pull request #1454 from marquiz/devel/docs-ers
docs: stop advertising --resource-labels flag
2023-11-08 10:39:50 +01:00
Markus Lehtonen
67d6231318 docs: stop advertising --resource-labels flag 2023-11-08 10:47:37 +02:00
Kubernetes Prow Robot
7af3c7643e
Merge pull request #1453 from fidencio/topic/update-cpuid
go.mod: Update cpuid to its v2.2.6 release
2023-11-06 20:42:10 +01:00
Fabiano Fidêncio
42ad6699cf go.mod: Update cpuid to its v2.2.6 release
Let's update the cpuid to v2.2.6 release, released on November 6th 2023,
as it brings information about TDX Guests virtualised atop of Hyper-V.

cpuid's changelog:
```
v2.2.6 (Latest)

What's Changed
* Add Intel apx, avx10, keylocker by klauspost in 134
* Update README.md by klauspost in 136
* Detect TDX Guest when it's virtualised using Hyper-V by fidencio in 138
```

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-11-06 18:39:45 +01:00
AhmedGrati
ae08e5998f feat: discover virtual network interfaces
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-11-05 19:46:33 +01:00
Kubernetes Prow Robot
536a006b93
Merge pull request #1452 from marquiz/devel/network-refactoring
source/network: refactor readIfaceInfo
2023-11-05 07:48:32 +01:00
Markus Lehtonen
eebd246bd7 source/network: refactor readIfaceInfo
Make the function more generic and re-usable.
2023-11-03 13:51:17 +02:00
Kubernetes Prow Robot
81dfff37a0
Merge pull request #1449 from marquiz/devel/docs
docs: use correct storage.block name for block device feature
2023-11-03 09:03:37 +01:00
Markus Lehtonen
d9b4d9bbd6 docs: use correct storage.block name for block device feature 2023-11-03 09:21:20 +02:00
Kubernetes Prow Robot
2964d790d5
Merge pull request #1447 from marquiz/devel/docs
docs: fix documentation on SEV security features
2023-11-02 16:54:50 +01:00
Markus Lehtonen
14d26f2c47 docs: fix documentation on SEV security features
First, fix a typo s/sex/sev/. Second, these features are not advertised
as node labels but only as "raw" features available for consumption in
NodeFeatureRules.
2023-11-02 17:35:55 +02:00
Kubernetes Prow Robot
a417ada6d8
Merge pull request #1445 from marquiz/devel/deps
go.mod: update deps
2023-10-30 14:16:43 +01:00
Markus Lehtonen
613e0f1f11 go.mod: update deps 2023-10-30 13:56:01 +02:00
Kubernetes Prow Robot
72fc478ab5
Merge pull request #1443 from marquiz/devel/e2e-annotations-cleanup
test/e2e: cleanup feature annotations
2023-10-27 16:46:20 +02:00
Markus Lehtonen
7015dae352 test/e2e: cleanup feature annotations
Delete NFD-managed feature annotations at test setup and teardown
2023-10-27 15:17:54 +03:00
Kubernetes Prow Robot
6b90401950
Merge pull request #1440 from marquiz/devel/e2e-fix
test/e2e: fix broken feature-annotations test
2023-10-27 11:16:02 +02:00
Kubernetes Prow Robot
362691a6f1
Merge pull request #1442 from marquiz/devel/e2e-rename
test/e2e: improved test logging
2023-10-27 09:41:23 +02:00
Markus Lehtonen
f732342a2a test/e2e: improved test logging 2023-10-27 10:21:11 +03:00
Kubernetes Prow Robot
053d9ea6f6
Merge pull request #1441 from marquiz/devel/e2e-typos
test/e2e: fix log messages
2023-10-26 22:34:25 +02:00
Markus Lehtonen
0fa330f2d4 test/e2e: fix log messages
Fix some typos and improve log messages a bit.
2023-10-26 23:01:08 +03:00
Markus Lehtonen
0d766a0fde test/e2e: fix broken feature-annotations test 2023-10-26 22:56:14 +03:00