Skip to content

Commit bae4122

Browse files
committed
deprecate nodefeature for feature labels
1 parent e69a5ed commit bae4122

39 files changed

+63
-277
lines changed

test/e2e/common/node/container_probe.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import (
3939
"k8s.io/kubernetes/test/e2e/framework"
4040
e2eevents "k8s.io/kubernetes/test/e2e/framework/events"
4141
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
42-
"k8s.io/kubernetes/test/e2e/nodefeature"
4342
testutils "k8s.io/kubernetes/test/utils"
4443
imageutils "k8s.io/kubernetes/test/utils/image"
4544
admissionapi "k8s.io/pod-security-admission/api"
@@ -730,7 +729,7 @@ done
730729
})
731730
})
732731

733-
var _ = SIGDescribe(nodefeature.SidecarContainers, feature.SidecarContainers, "Probing restartable init container", func() {
732+
var _ = SIGDescribe(feature.SidecarContainers, "Probing restartable init container", func() {
734733
f := framework.NewDefaultFramework("container-probe")
735734
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
736735
var podClient *e2epod.PodClient

test/e2e/common/node/downwardapi.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"k8s.io/kubernetes/test/e2e/framework"
2929
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
3030
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
31-
"k8s.io/kubernetes/test/e2e/nodefeature"
3231
imageutils "k8s.io/kubernetes/test/utils/image"
3332
admissionapi "k8s.io/pod-security-admission/api"
3433

@@ -315,7 +314,7 @@ var _ = SIGDescribe("Downward API", func() {
315314
})
316315
})
317316

318-
var _ = SIGDescribe("Downward API", framework.WithSerial(), framework.WithDisruptive(), nodefeature.DownwardAPIHugePages, feature.DownwardAPIHugePages, func() {
317+
var _ = SIGDescribe("Downward API", framework.WithSerial(), framework.WithDisruptive(), feature.DownwardAPIHugePages, func() {
319318
f := framework.NewDefaultFramework("downward-api")
320319
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
321320

test/e2e/common/node/lifecycle_hook.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"k8s.io/kubernetes/test/e2e/framework"
3030
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
3131
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
32-
"k8s.io/kubernetes/test/e2e/nodefeature"
3332
imageutils "k8s.io/kubernetes/test/utils/image"
3433
admissionapi "k8s.io/pod-security-admission/api"
3534

@@ -255,7 +254,7 @@ var _ = SIGDescribe("Container Lifecycle Hook", func() {
255254
})
256255
})
257256

258-
var _ = SIGDescribe(nodefeature.SidecarContainers, feature.SidecarContainers, "Restartable Init Container Lifecycle Hook", func() {
257+
var _ = SIGDescribe(feature.SidecarContainers, "Restartable Init Container Lifecycle Hook", func() {
259258
f := framework.NewDefaultFramework("restartable-init-container-lifecycle-hook")
260259
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
261260
var podClient *e2epod.PodClient

test/e2e/common/node/runtimeclass.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import (
3939
e2eruntimeclass "k8s.io/kubernetes/test/e2e/framework/node/runtimeclass"
4040
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
4141
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
42-
"k8s.io/kubernetes/test/e2e/nodefeature"
4342
admissionapi "k8s.io/pod-security-admission/api"
4443

4544
"github.com/onsi/ginkgo/v2"
@@ -61,7 +60,7 @@ var _ = SIGDescribe("RuntimeClass", func() {
6160
})
6261

6362
// The test CANNOT be made a Conformance as it depends on a container runtime to have a specific handler not being installed.
64-
f.It("should reject a Pod requesting a RuntimeClass with an unconfigured handler", nodefeature.RuntimeHandler, feature.RuntimeHandler, func(ctx context.Context) {
63+
f.It("should reject a Pod requesting a RuntimeClass with an unconfigured handler", feature.RuntimeHandler, func(ctx context.Context) {
6564
handler := f.Namespace.Name + "-handler"
6665
rcName := createRuntimeClass(ctx, f, "unconfigured-handler", handler, nil)
6766
ginkgo.DeferCleanup(deleteRuntimeClass, f, rcName)
@@ -85,7 +84,7 @@ var _ = SIGDescribe("RuntimeClass", func() {
8584

8685
// This test requires that the PreconfiguredRuntimeClassHandler has already been set up on nodes.
8786
// The test CANNOT be made a Conformance as it depends on a container runtime to have a specific handler installed and working.
88-
f.It("should run a Pod requesting a RuntimeClass with a configured handler", nodefeature.RuntimeHandler, feature.RuntimeHandler, func(ctx context.Context) {
87+
f.It("should run a Pod requesting a RuntimeClass with a configured handler", feature.RuntimeHandler, func(ctx context.Context) {
8988
if err := e2eruntimeclass.NodeSupportsPreconfiguredRuntimeClassHandler(ctx, f); err != nil {
9089
e2eskipper.Skipf("Skipping test as node does not have E2E runtime class handler preconfigured in container runtime config: %v", err)
9190
}

test/e2e/common/node/security_context.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
3232
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
3333
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
34-
"k8s.io/kubernetes/test/e2e/nodefeature"
3534
imageutils "k8s.io/kubernetes/test/utils/image"
3635
admissionapi "k8s.io/pod-security-admission/api"
3736
"k8s.io/utils/pointer"
@@ -541,7 +540,7 @@ var _ = SIGDescribe("Security Context", func() {
541540
}
542541
})
543542

544-
f.It("should run the container as privileged when true [LinuxOnly]", nodefeature.HostAccess, feature.HostAccess, func(ctx context.Context) {
543+
f.It("should run the container as privileged when true [LinuxOnly]", feature.HostAccess, func(ctx context.Context) {
545544
podName := createAndWaitUserPod(ctx, true)
546545
logs, err := e2epod.GetPodLogs(ctx, f.ClientSet, f.Namespace.Name, podName, podName)
547546
if err != nil {

test/e2e/e2e_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import (
4343

4444
// define and freeze constants
4545
_ "k8s.io/kubernetes/test/e2e/feature"
46-
_ "k8s.io/kubernetes/test/e2e/nodefeature"
4746

4847
// test sources
4948
_ "k8s.io/kubernetes/test/e2e/apimachinery"

test/e2e/framework/ginkgowrapper.go

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ type Feature string
4141
// "Linux" or "Windows".
4242
type Environment string
4343

44-
// NodeFeature is the name of a feature that a node must support. To be
45-
// removed, see
46-
// https://github.com/kubernetes/enhancements/tree/master/keps/sig-testing/3041-node-conformance-and-features#nodefeature.
47-
type NodeFeature string
48-
4944
type Valid[T comparable] struct {
5045
items sets.Set[T]
5146
frozen bool
@@ -76,14 +71,13 @@ func (v *Valid[T]) Freeze() {
7671
v.frozen = true
7772
}
7873

79-
// These variables contain the parameters that [WithFeature], [WithEnvironment]
80-
// and [WithNodeFeatures] accept. The framework itself has no pre-defined
74+
// These variables contain the parameters that [WithFeature] and [WithEnvironment] accept.
75+
// The framework itself has no pre-defined
8176
// constants. Test suites and tests may define their own and then add them here
8277
// before calling these With functions.
8378
var (
8479
ValidFeatures Valid[Feature]
8580
ValidEnvironments Valid[Environment]
86-
ValidNodeFeatures Valid[NodeFeature]
8781
)
8882

8983
var errInterface = reflect.TypeOf((*error)(nil)).Elem()
@@ -421,28 +415,6 @@ func withEnvironment(name Environment) interface{} {
421415
return newLabel("Environment", string(name))
422416
}
423417

424-
// WithNodeFeature specifies that a certain test or group of tests only works
425-
// if the node supports a certain feature. The return value must be passed as
426-
// additional argument to [framework.It], [framework.Describe],
427-
// [framework.Context].
428-
//
429-
// The environment must be listed in ValidNodeFeatures.
430-
func WithNodeFeature(name NodeFeature) interface{} {
431-
return withNodeFeature(name)
432-
}
433-
434-
// WithNodeFeature is a shorthand for the corresponding package function.
435-
func (f *Framework) WithNodeFeature(name NodeFeature) interface{} {
436-
return withNodeFeature(name)
437-
}
438-
439-
func withNodeFeature(name NodeFeature) interface{} {
440-
if !ValidNodeFeatures.items.Has(name) {
441-
RecordBug(NewBug(fmt.Sprintf("WithNodeFeature: unknown environment %q", name), 2))
442-
}
443-
return newLabel("NodeFeature", string(name))
444-
}
445-
446418
// WithConformace specifies that a certain test or group of tests must pass in
447419
// all conformant Kubernetes clusters. The return value must be passed as
448420
// additional argument to [framework.It], [framework.Describe],

test/e2e/framework/internal/unittests/bugs/bugs.go

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ func RecordBugs() {
6363
var (
6464
validFeature = framework.ValidFeatures.Add("feature-foo")
6565
validEnvironment = framework.ValidEnvironments.Add("Linux")
66-
validNodeFeature = framework.ValidNodeFeatures.Add("node-feature-foo")
6766
)
6867

6968
func Describe() {
@@ -78,8 +77,6 @@ func Describe() {
7877
framework.WithFeature(validFeature),
7978
framework.WithEnvironment("no-such-env"),
8079
framework.WithEnvironment(validEnvironment),
81-
framework.WithNodeFeature("no-such-node-env"),
82-
framework.WithNodeFeature(validNodeFeature),
8380
framework.WithFeatureGate("no-such-feature-gate"),
8481
framework.WithFeatureGate(features.Alpha),
8582
framework.WithFeatureGate(features.Beta),
@@ -113,21 +110,20 @@ const (
113110
numBugs = 3
114111
bugOutput = `ERROR: bugs.go:53: new bug
115112
ERROR: bugs.go:58: parent
116-
ERROR: bugs.go:72: empty strings as separators are unnecessary and need to be removed
117-
ERROR: bugs.go:72: trailing or leading spaces are unnecessary and need to be removed: " space1"
118-
ERROR: bugs.go:72: trailing or leading spaces are unnecessary and need to be removed: "space2 "
119-
ERROR: bugs.go:77: WithFeature: unknown feature "no-such-feature"
120-
ERROR: bugs.go:79: WithEnvironment: unknown environment "no-such-env"
121-
ERROR: bugs.go:81: WithNodeFeature: unknown environment "no-such-node-env"
122-
ERROR: bugs.go:83: WithFeatureGate: the feature gate "no-such-feature-gate" is unknown
123-
ERROR: bugs.go:109: SIG label must be lowercase, no spaces and no sig- prefix, got instead: "123"
113+
ERROR: bugs.go:71: empty strings as separators are unnecessary and need to be removed
114+
ERROR: bugs.go:71: trailing or leading spaces are unnecessary and need to be removed: " space1"
115+
ERROR: bugs.go:71: trailing or leading spaces are unnecessary and need to be removed: "space2 "
116+
ERROR: bugs.go:76: WithFeature: unknown feature "no-such-feature"
117+
ERROR: bugs.go:78: WithEnvironment: unknown environment "no-such-env"
118+
ERROR: bugs.go:80: WithFeatureGate: the feature gate "no-such-feature-gate" is unknown
119+
ERROR: bugs.go:106: SIG label must be lowercase, no spaces and no sig- prefix, got instead: "123"
124120
ERROR: buggy/buggy.go:100: hello world
125121
ERROR: some/relative/path/buggy.go:200: with spaces
126122
`
127123
// Used by unittests/list-tests. It's sorted by test name, not source code location.
128124
ListTestsOutput = `The following spec names can be used with 'ginkgo run --focus/skip':
129-
../bugs/bugs.go:103: [sig-testing] abc space1 space2 [Feature:no-such-feature] [Feature:feature-foo] [Environment:no-such-env] [Environment:Linux] [NodeFeature:no-such-node-env] [NodeFeature:node-feature-foo] [FeatureGate:no-such-feature-gate] [FeatureGate:TestAlphaFeature] [Alpha] [FeatureGate:TestBetaFeature] [Beta] [FeatureGate:TestGAFeature] [Conformance] [NodeConformance] [Slow] [Serial] [Disruptive] [custom-label] xyz x [foo] should [bar]
130-
../bugs/bugs.go:98: [sig-testing] abc space1 space2 [Feature:no-such-feature] [Feature:feature-foo] [Environment:no-such-env] [Environment:Linux] [NodeFeature:no-such-node-env] [NodeFeature:node-feature-foo] [FeatureGate:no-such-feature-gate] [FeatureGate:TestAlphaFeature] [Alpha] [FeatureGate:TestBetaFeature] [Beta] [FeatureGate:TestGAFeature] [Conformance] [NodeConformance] [Slow] [Serial] [Disruptive] [custom-label] xyz y [foo] should [bar]
125+
../bugs/bugs.go:100: [sig-testing] abc space1 space2 [Feature:no-such-feature] [Feature:feature-foo] [Environment:no-such-env] [Environment:Linux] [FeatureGate:no-such-feature-gate] [FeatureGate:TestAlphaFeature] [Alpha] [FeatureGate:TestBetaFeature] [Beta] [FeatureGate:TestGAFeature] [Conformance] [NodeConformance] [Slow] [Serial] [Disruptive] [custom-label] xyz x [foo] should [bar]
126+
../bugs/bugs.go:95: [sig-testing] abc space1 space2 [Feature:no-such-feature] [Feature:feature-foo] [Environment:no-such-env] [Environment:Linux] [FeatureGate:no-such-feature-gate] [FeatureGate:TestAlphaFeature] [Alpha] [FeatureGate:TestBetaFeature] [Beta] [FeatureGate:TestGAFeature] [Conformance] [NodeConformance] [Slow] [Serial] [Disruptive] [custom-label] xyz y [foo] should [bar]
131127
132128
`
133129

@@ -146,8 +142,6 @@ ERROR: some/relative/path/buggy.go:200: with spaces
146142
FeatureGate:TestGAFeature
147143
FeatureGate:no-such-feature-gate
148144
NodeConformance
149-
NodeFeature:no-such-node-env
150-
NodeFeature:node-feature-foo
151145
Serial
152146
Slow
153147
bar

test/e2e/node/node_problem_detector.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
3535
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
3636
e2essh "k8s.io/kubernetes/test/e2e/framework/ssh"
37-
"k8s.io/kubernetes/test/e2e/nodefeature"
3837
testutils "k8s.io/kubernetes/test/utils"
3938
admissionapi "k8s.io/pod-security-admission/api"
4039

@@ -44,7 +43,7 @@ import (
4443

4544
// This test checks if node-problem-detector (NPD) runs fine without error on
4645
// the up to 10 nodes in the cluster. NPD's functionality is tested in e2e_node tests.
47-
var _ = SIGDescribe("NodeProblemDetector", nodefeature.NodeProblemDetector, feature.NodeProblemDetector, func() {
46+
var _ = SIGDescribe("NodeProblemDetector", feature.NodeProblemDetector, func() {
4847
const (
4948
pollInterval = 1 * time.Second
5049
pollTimeout = 1 * time.Minute

test/e2e/nodefeature/OWNERS

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)