diff --git a/pkg/api/pod/util.go b/pkg/api/pod/util.go index 464e31a56c4..e394b98f478 100644 --- a/pkg/api/pod/util.go +++ b/pkg/api/pod/util.go @@ -30,6 +30,7 @@ import ( "k8s.io/kubernetes/pkg/apis/core/helper" apivalidation "k8s.io/kubernetes/pkg/apis/core/validation" "k8s.io/kubernetes/pkg/features" + "k8s.io/kubernetes/test/e2e/framework" ) // ContainerType signifies container type @@ -746,7 +747,7 @@ func dropDisabledFields( } } - if !utilfeature.DefaultFeatureGate.Enabled(features.SidecarContainers) && !restartableInitContainersInUse(oldPodSpec) { + if !utilfeature.DefaultFeatureGate.Enabled(framework.WithNodeConformance()) && !restartableInitContainersInUse(oldPodSpec) { // Drop the RestartPolicy field of init containers. for i := range podSpec.InitContainers { podSpec.InitContainers[i].RestartPolicy = nil diff --git a/pkg/controller/job/backoff_utils.go b/pkg/controller/job/backoff_utils.go index 47a07d2ad39..19c3962dc16 100644 --- a/pkg/controller/job/backoff_utils.go +++ b/pkg/controller/job/backoff_utils.go @@ -27,7 +27,7 @@ import ( "k8s.io/client-go/tools/cache" "k8s.io/klog/v2" apipod "k8s.io/kubernetes/pkg/api/v1/pod" - "k8s.io/kubernetes/pkg/features" + framework "k8s.io/kubernetes/test/e2e/framework" "k8s.io/utils/clock" "k8s.io/utils/ptr" ) @@ -187,7 +187,7 @@ func getFinishedTime(p *v1.Pod) time.Time { func getFinishTimeFromContainers(p *v1.Pod) *time.Time { finishTime := latestFinishTime(nil, p.Status.ContainerStatuses, nil) - if utilfeature.DefaultFeatureGate.Enabled(features.SidecarContainers) { + if utilfeature.DefaultFeatureGate.Enabled(framework.WithNodeConformance()) { // We need to check InitContainerStatuses here also, // because with the sidecar (restartable init) containers, // sidecar containers will always finish later than regular containers. diff --git a/test/e2e/common/node/lifecycle_hook.go b/test/e2e/common/node/lifecycle_hook.go index f2982c1efe1..345f4c01865 100644 --- a/test/e2e/common/node/lifecycle_hook.go +++ b/test/e2e/common/node/lifecycle_hook.go @@ -258,7 +258,7 @@ var _ = SIGDescribe("Container Lifecycle Hook", func() { }) }) -var _ = SIGDescribe(feature.SidecarContainers, framework.WithFeatureGate(features.SidecarContainers), "Restartable Init Container Lifecycle Hook", func() { +var _ = SIGDescribe(framework.WithNodeConformance(), framework.WithFeatureGate(features.SidecarContainers), "Restartable Init Container Lifecycle Hook", func() { f := framework.NewDefaultFramework("restartable-init-container-lifecycle-hook") // FIXME: This test is being run in the privileged mode because of https://github.com/kubernetes/kubernetes/issues/133091 f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged diff --git a/test/e2e/feature/feature.go b/test/e2e/feature/feature.go index 0485df90947..d96ccafd800 100644 --- a/test/e2e/feature/feature.go +++ b/test/e2e/feature/feature.go @@ -411,10 +411,6 @@ var ( // and the networking.k8s.io/v1alpha1 API. ServiceCIDRs = framework.WithFeature(framework.ValidFeatures.Add("ServiceCIDRs")) - // Owner: sig-node - // Sidecar KEP-753 - SidecarContainers = framework.WithFeature(framework.ValidFeatures.Add("SidecarContainers")) - // TODO: document the feature (owning SIG, when to use this feature for a test) StackdriverAcceleratorMonitoring = framework.WithFeature(framework.ValidFeatures.Add("StackdriverAcceleratorMonitoring")) diff --git a/test/e2e_node/container_lifecycle_test.go b/test/e2e_node/container_lifecycle_test.go index 9608823c780..1767e200808 100644 --- a/test/e2e_node/container_lifecycle_test.go +++ b/test/e2e_node/container_lifecycle_test.go @@ -29,7 +29,6 @@ import ( runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1" admissionapi "k8s.io/pod-security-admission/api" - "k8s.io/kubernetes/test/e2e/feature" "k8s.io/kubernetes/test/e2e/framework" e2epod "k8s.io/kubernetes/test/e2e/framework/pod" imageutils "k8s.io/kubernetes/test/utils/image" @@ -2121,7 +2120,7 @@ var _ = SIGDescribe(framework.WithSerial(), "Containers Lifecycle", func() { }) }) -var _ = SIGDescribe(feature.SidecarContainers, "Containers Lifecycle", func() { +var _ = SIGDescribe(framework.WithNodeConformance(), "Containers Lifecycle", func() { f := framework.NewDefaultFramework("containers-lifecycle-test") addAfterEachForCleaningUpPods(f) f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged @@ -6016,7 +6015,7 @@ fi`}, }) -var _ = SIGDescribe(feature.SidecarContainers, framework.WithSerial(), "Containers Lifecycle", func() { +var _ = SIGDescribe(framework.WithNodeConformance(), framework.WithSerial(), "Containers Lifecycle", func() { f := framework.NewDefaultFramework("containers-lifecycle-test-serial") addAfterEachForCleaningUpPods(f) f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged diff --git a/test/e2e_node/device_plugin_test.go b/test/e2e_node/device_plugin_test.go index c5e5023d45e..0d125a4db1d 100644 --- a/test/e2e_node/device_plugin_test.go +++ b/test/e2e_node/device_plugin_test.go @@ -692,7 +692,7 @@ func testDevicePlugin(f *framework.Framework, pluginSockDir string) { } }) - f.It("Can schedule a pod with a restartable init container", feature.SidecarContainers, func(ctx context.Context) { + f.It("Can schedule a pod with a restartable init container", framework.WithNodeConformance(), func(ctx context.Context) { podRECMD := "devs=$(ls /tmp/ | egrep '^Dev-[0-9]+$') && echo stub devices: $devs && sleep %s" sleepOneSecond := "1s" rl := v1.ResourceList{v1.ResourceName(SampleDeviceResourceName): *resource.NewQuantity(1, resource.DecimalSI)} diff --git a/test/e2e_node/podresources_test.go b/test/e2e_node/podresources_test.go index df42797f4c4..3d55705a043 100644 --- a/test/e2e_node/podresources_test.go +++ b/test/e2e_node/podresources_test.go @@ -1113,7 +1113,7 @@ var _ = SIGDescribe("POD Resources API", framework.WithSerial(), feature.PodReso podresourcesGetAllocatableResourcesTests(ctx, cli, sd, onlineCPUs, reservedSystemCPUs) }) - framework.It("should return the expected responses", feature.SidecarContainers, func(ctx context.Context) { + framework.It("should return the expected responses", framework.WithNodeConformance(), func(ctx context.Context) { onlineCPUs, err := getOnlineCPUs() framework.ExpectNoError(err, "getOnlineCPUs() failed err: %v", err) @@ -1259,7 +1259,7 @@ var _ = SIGDescribe("POD Resources API", framework.WithSerial(), feature.PodReso podresourcesGetTests(ctx, f, cli, false) }) - framework.It("should return the expected responses", feature.SidecarContainers, func(ctx context.Context) { + framework.It("should return the expected responses", framework.WithNodeConformance(), func(ctx context.Context) { onlineCPUs, err := getOnlineCPUs() framework.ExpectNoError(err, "getOnlineCPUs() failed err: %v", err)