1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-15 04:57:56 +00:00

Merge pull request #827 from marquiz/devel/drop-iommu

Drop the iommu source
This commit is contained in:
Kubernetes Prow Robot 2022-07-08 02:01:47 -07:00 committed by GitHub
commit 3df81d1ace
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 1 additions and 78 deletions

View file

@ -144,14 +144,6 @@ See the full list in [github.com/klauspost/cpuid][klauspost-cpuid].
| RDTl2CA | Intel L2 Cache Allocation Technology | RDTl2CA | Intel L2 Cache Allocation Technology
| RDTMBA | Intel Memory Bandwidth Allocation (MBA) Technology | RDTMBA | Intel Memory Bandwidth Allocation (MBA) Technology
### IOMMU (deprecated)
| Feature | Value | Description
| ------------------- | ----- | -----------
| **`iommu.enabled`** | true | IOMMU is present and enabled in the kernel
**DEPRECATED**: The **iommu** source is deprecated and not enabled by default.
### Kernel ### Kernel
| Feature | Value | Description | Feature | Value | Description

View file

@ -61,7 +61,6 @@ Feature discovery is divided into domain-specific feature sources:
- USB - USB
- Custom (rule-based custom features) - Custom (rule-based custom features)
- Local (hooks for user-specific features) - Local (hooks for user-specific features)
- IOMMU (*deprecated*)
Each feature source is responsible for detecting a set of features which. in Each feature source is responsible for detecting a set of features which. in
turn, are turned into node feature labels. Feature labels are prefixed with turn, are turned into node feature labels. Feature labels are prefixed with

View file

@ -317,7 +317,7 @@ func TestNewNfdWorker(t *testing.T) {
So(worker.configure("", ""), ShouldBeNil) So(worker.configure("", ""), ShouldBeNil)
Convey("all sources should be enabled and the whitelist regexp should be empty", func() { Convey("all sources should be enabled and the whitelist regexp should be empty", func() {
So(len(worker.featureSources), ShouldEqual, len(source.GetAllFeatureSources())-1) So(len(worker.featureSources), ShouldEqual, len(source.GetAllFeatureSources())-1)
So(len(worker.labelSources), ShouldEqual, len(source.GetAllLabelSources())-2) So(len(worker.labelSources), ShouldEqual, len(source.GetAllLabelSources())-1)
So(worker.config.Core.LabelWhiteList, ShouldResemble, emptyRegexp) So(worker.config.Core.LabelWhiteList, ShouldResemble, emptyRegexp)
}) })
}) })

View file

@ -43,7 +43,6 @@ import (
_ "sigs.k8s.io/node-feature-discovery/source/cpu" _ "sigs.k8s.io/node-feature-discovery/source/cpu"
_ "sigs.k8s.io/node-feature-discovery/source/custom" _ "sigs.k8s.io/node-feature-discovery/source/custom"
_ "sigs.k8s.io/node-feature-discovery/source/fake" _ "sigs.k8s.io/node-feature-discovery/source/fake"
_ "sigs.k8s.io/node-feature-discovery/source/iommu"
_ "sigs.k8s.io/node-feature-discovery/source/kernel" _ "sigs.k8s.io/node-feature-discovery/source/kernel"
_ "sigs.k8s.io/node-feature-discovery/source/local" _ "sigs.k8s.io/node-feature-discovery/source/local"
_ "sigs.k8s.io/node-feature-discovery/source/memory" _ "sigs.k8s.io/node-feature-discovery/source/memory"

View file

@ -1,65 +0,0 @@
/*
Copyright 2018-2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package iommu
import (
"fmt"
"io/ioutil"
"sigs.k8s.io/node-feature-discovery/source"
)
// Name of this feature source
const Name = "iommu"
// iommuSource implements the LabelSource interface.
type iommuSource struct{}
func (s *iommuSource) Name() string { return Name }
// Singleton source instance
var (
src iommuSource
_ source.LabelSource = &src
)
// Priority method of the LabelSource interface
func (s *iommuSource) Priority() int { return 0 }
// GetLabels method of the LabelSource interface
func (s *iommuSource) GetLabels() (source.FeatureLabels, error) {
features := source.FeatureLabels{}
// Check if any iommu devices are available
devices, err := ioutil.ReadDir(source.SysfsDir.Path("class/iommu/"))
if err != nil {
return nil, fmt.Errorf("failed to check for IOMMU support: %v", err)
}
if len(devices) > 0 {
features["enabled"] = true
}
return features, nil
}
// DisableByDefault method of the SupplementalSource interface.
func (s *iommuSource) DisableByDefault() bool { return true }
func init() {
source.Register(&src)
}

View file

@ -28,7 +28,6 @@ import (
_ "sigs.k8s.io/node-feature-discovery/source/cpu" _ "sigs.k8s.io/node-feature-discovery/source/cpu"
_ "sigs.k8s.io/node-feature-discovery/source/custom" _ "sigs.k8s.io/node-feature-discovery/source/custom"
_ "sigs.k8s.io/node-feature-discovery/source/fake" _ "sigs.k8s.io/node-feature-discovery/source/fake"
_ "sigs.k8s.io/node-feature-discovery/source/iommu"
_ "sigs.k8s.io/node-feature-discovery/source/kernel" _ "sigs.k8s.io/node-feature-discovery/source/kernel"
_ "sigs.k8s.io/node-feature-discovery/source/local" _ "sigs.k8s.io/node-feature-discovery/source/local"
_ "sigs.k8s.io/node-feature-discovery/source/memory" _ "sigs.k8s.io/node-feature-discovery/source/memory"

View file

@ -52,7 +52,6 @@ defaultFeatures:
- "feature.node.kubernetes.io/cpu-rdt.RDTMBA" - "feature.node.kubernetes.io/cpu-rdt.RDTMBA"
- "feature.node.kubernetes.io/cpu-rdt.RDTMBM" - "feature.node.kubernetes.io/cpu-rdt.RDTMBM"
- "feature.node.kubernetes.io/cpu-rdt.RDTMON" - "feature.node.kubernetes.io/cpu-rdt.RDTMON"
- "feature.node.kubernetes.io/iommu-enabled"
- "feature.node.kubernetes.io/kernel-config.NO_HZ" - "feature.node.kubernetes.io/kernel-config.NO_HZ"
- "feature.node.kubernetes.io/kernel-config.NO_HZ_FULL" - "feature.node.kubernetes.io/kernel-config.NO_HZ_FULL"
- "feature.node.kubernetes.io/kernel-config.NO_HZ_IDLE" - "feature.node.kubernetes.io/kernel-config.NO_HZ_IDLE"