From bd30b0adef64e75c79041781dc4744758ea60551 Mon Sep 17 00:00:00 2001 From: carlory Date: Wed, 4 Jun 2025 10:10:57 +0800 Subject: [PATCH] remove general avaliable feature-gate DevicePluginCDIDevices Signed-off-by: carlory --- pkg/features/kube_features.go | 12 ------------ pkg/kubelet/cm/devicemanager/pod_devices.go | 10 +++------- .../reference/versioned_feature_list.yaml | 14 -------------- test/e2e/feature/feature.go | 6 ------ test/e2e_node/device_plugin_test.go | 8 ++------ 5 files changed, 5 insertions(+), 45 deletions(-) diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index 8c11c6d9505..61629b9024f 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -229,12 +229,6 @@ const ( // Deployments and replica sets can now also track terminating pods via .status.terminatingReplicas. DeploymentReplicaSetTerminatingReplicas featuregate.Feature = "DeploymentReplicaSetTerminatingReplicas" - // owner: @elezar - // kep: http://kep.k8s.io/4009 - // - // Add support for CDI Device IDs in the Device Plugin API. - DevicePluginCDIDevices featuregate.Feature = "DevicePluginCDIDevices" - // owner: @aojea // // The apiservers with the MultiCIDRServiceAllocator feature enable, in order to support live migration from the old bitmap ClusterIP @@ -1149,12 +1143,6 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, }, - DevicePluginCDIDevices: { - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.33 - }, - DisableAllocatorDualWrite: { {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta}, diff --git a/pkg/kubelet/cm/devicemanager/pod_devices.go b/pkg/kubelet/cm/devicemanager/pod_devices.go index 806ab3c616d..7cdd311c60b 100644 --- a/pkg/kubelet/cm/devicemanager/pod_devices.go +++ b/pkg/kubelet/cm/devicemanager/pod_devices.go @@ -23,9 +23,7 @@ import ( "k8s.io/klog/v2" "k8s.io/apimachinery/pkg/util/sets" - utilfeature "k8s.io/apiserver/pkg/util/feature" pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1" - kubefeatures "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/checkpoint" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" ) @@ -344,11 +342,9 @@ func (pdev *podDevices) deviceRunContainerOptions(podUID, contName string) *Devi opts.Annotations = append(opts.Annotations, kubecontainer.Annotation{Name: k, Value: v}) } - if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.DevicePluginCDIDevices) { - // Updates for CDI devices. - cdiDevices := getCDIDeviceInfo(resp, allCDIDevices) - opts.CDIDevices = append(opts.CDIDevices, cdiDevices...) - } + // Updates for CDI devices. + cdiDevices := getCDIDeviceInfo(resp, allCDIDevices) + opts.CDIDevices = append(opts.CDIDevices, cdiDevices...) } return opts diff --git a/test/compatibility_lifecycle/reference/versioned_feature_list.yaml b/test/compatibility_lifecycle/reference/versioned_feature_list.yaml index 728fb64d1b4..0ac4a15dcd6 100644 --- a/test/compatibility_lifecycle/reference/versioned_feature_list.yaml +++ b/test/compatibility_lifecycle/reference/versioned_feature_list.yaml @@ -407,20 +407,6 @@ lockToDefault: false preRelease: Beta version: "1.34" -- name: DevicePluginCDIDevices - versionedSpecs: - - default: false - lockToDefault: false - preRelease: Alpha - version: "1.28" - - default: true - lockToDefault: false - preRelease: Beta - version: "1.29" - - default: true - lockToDefault: true - preRelease: GA - version: "1.31" - name: DisableAllocatorDualWrite versionedSpecs: - default: false diff --git a/test/e2e/feature/feature.go b/test/e2e/feature/feature.go index e096674e36f..7ec68090767 100644 --- a/test/e2e/feature/feature.go +++ b/test/e2e/feature/feature.go @@ -106,12 +106,6 @@ var ( // Testing device plugins DevicePlugin = framework.WithFeature(framework.ValidFeatures.Add("DevicePlugin")) - // owning-sig: sig-node - // kep: https://kep.k8s.io/4009 - // DevicePluginCDIDevices tests the CDI feature which is GA. - // This label is used for https://testgrid.k8s.io/sig-node-cri-o#ci-crio-cdi-device-plugins - DevicePluginCDIDevices = framework.WithFeature(framework.ValidFeatures.Add("DevicePluginCDIDevices")) - // TODO: document the feature (owning SIG, when to use this feature for a test) Downgrade = framework.WithFeature(framework.ValidFeatures.Add("Downgrade")) diff --git a/test/e2e_node/device_plugin_test.go b/test/e2e_node/device_plugin_test.go index ea4ee9be1d6..7fe48fd8e7a 100644 --- a/test/e2e_node/device_plugin_test.go +++ b/test/e2e_node/device_plugin_test.go @@ -37,7 +37,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer" k8stypes "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" - utilfeature "k8s.io/apiserver/pkg/util/feature" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1" kubeletdevicepluginv1beta1 "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1" admissionapi "k8s.io/pod-security-admission/api" @@ -48,7 +47,6 @@ import ( "k8s.io/kubectl/pkg/util/podutils" kubeletpodresourcesv1 "k8s.io/kubelet/pkg/apis/podresources/v1" kubeletpodresourcesv1alpha1 "k8s.io/kubelet/pkg/apis/podresources/v1alpha1" - "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/test/e2e/feature" "k8s.io/kubernetes/test/e2e/framework" e2enode "k8s.io/kubernetes/test/e2e/framework/node" @@ -282,7 +280,7 @@ func testDevicePlugin(f *framework.Framework, pluginSockDir string) { gomega.Expect(v1ResourcesForOurPod.Containers[0].Devices[0].DeviceIds).To(gomega.HaveLen(1)) }) - f.It("can make a CDI device accessible in a container", feature.DevicePluginCDIDevices, func(ctx context.Context) { + f.It("can make a CDI device accessible in a container", func(ctx context.Context) { // check if CDI_DEVICE env variable is set // and only one correspondent device node /tmp/ is available inside a container podObj := makeBusyboxPod(SampleDeviceResourceName, "[ $(ls /tmp/CDI-Dev-[1,2] | wc -l) -eq 1 -a -b /tmp/$CDI_DEVICE ]") @@ -1120,9 +1118,7 @@ func getSampleDevicePluginPod(pluginSockDir string) *v1.Pod { } } - if utilfeature.DefaultFeatureGate.Enabled(features.DevicePluginCDIDevices) { - dp.Spec.Containers[0].Env = append(dp.Spec.Containers[0].Env, v1.EnvVar{Name: "CDI_ENABLED", Value: "1"}) - } + dp.Spec.Containers[0].Env = append(dp.Spec.Containers[0].Env, v1.EnvVar{Name: "CDI_ENABLED", Value: "1"}) return dp }