1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

network: rename sriov labels

Introduce a new scheme where features may have logical sub-components.
Rename sriov labels from the network source according to the new
pattern:
  sriov            -> sriov.capable
  sriov-configured -> sriov.configured

Also, document this new labeling scheme in the README.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
This commit is contained in:
Markus Lehtonen 2018-10-02 16:18:04 +03:00
parent 4bab607b82
commit 4fa7ae38e3
2 changed files with 15 additions and 6 deletions

View file

@ -82,13 +82,21 @@ The current set of feature sources are the following:
The published node labels encode a few pieces of information:
- A "namespace" (e.g. `node.alpha.kubernetes-incubator.io/nfd`).
- A "namespace" (e.g. `node.alpha.kubernetes-incubator.io`).
- The version of this discovery code that wrote the label, according to
`git describe --tags --dirty --always`.
- The source for each label (e.g. `cpuid`).
- The name of the discovered feature as it appears in the underlying
source, (e.g. `AESNI` from cpuid).
Feature label names adhere to the following pattern:
```
<namespace>/nfd-<source name>-<feature name>[.<attribute name>]
```
The last component (i.e. `attribute-name`) is optional, and only used if a
feature logically has sub-hierarchy, e.g. `sriov.capable` and
`sriov.configure` from the `network` source.
_Note: only features that are available on a given node are labeled, so
the only label value published for features is the string `"true"`._
@ -155,9 +163,10 @@ such as restricting discovered features with the --label-whitelist option._
### Network Features
| Feature name | Description |
| :------------: | :---------------------------------------------------------------------------------: |
| [SRIOV][sriov] | Single Root Input/Output Virtualization (SR-IOV) enabled Network Interface Card
| Feature | Attribute | Description |
| ------- | ---------- | ----------------------------------------------------- |
| sriov | capable | [Single Root Input/Output Virtualization][sriov] (SR-IOV) enabled Network Interface Card(s) present
| <br> | configured | SR-IOV virtual functions have been configured
### RDT (Intel Resource Director Technology) Features

View file

@ -57,7 +57,7 @@ func (s Source) Discover() ([]string, error) {
if t > 0 {
glog.Infof("SR-IOV capability is detected on the network interface: %s", netInterface.Name)
glog.Infof("%d maximum supported number of virtual functions on network interface: %s", t, netInterface.Name)
features = append(features, "sriov")
features = append(features, "sriov.capable")
numVfsPath := "/sys/class/net/" + netInterface.Name + "/device/sriov_numvfs"
numBytes, err := ioutil.ReadFile(numVfsPath)
if err != nil {
@ -72,7 +72,7 @@ func (s Source) Discover() ([]string, error) {
}
if n > 0 {
glog.Infof("%d virtual functions configured on network interface: %s", n, netInterface.Name)
features = append(features, "sriov-configured")
features = append(features, "sriov.configured")
break
} else if n == 0 {
glog.Errorf("SR-IOV not configured on network interface: %s", netInterface.Name)