From 63992e1790d15154e6f880c43eacc70e42ecf920 Mon Sep 17 00:00:00 2001 From: carlory Date: Wed, 11 Dec 2024 10:43:05 +0800 Subject: [PATCH] dra e2e tests: add feature-gate label when these tests depend feature-gate --- test/e2e/dra/dra.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/e2e/dra/dra.go b/test/e2e/dra/dra.go index d8296d85113..c218a2df798 100644 --- a/test/e2e/dra/dra.go +++ b/test/e2e/dra/dra.go @@ -45,6 +45,7 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/dynamic-resource-allocation/resourceslice" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/test/e2e/feature" "k8s.io/kubernetes/test/e2e/framework" e2edaemonset "k8s.io/kubernetes/test/e2e/framework/daemonset" @@ -79,7 +80,7 @@ func perNode(maxAllocations int, nodes *Nodes) func() Resources { } } -var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, func() { +var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, framework.WithFeatureGate(features.DynamicResourceAllocation), func() { f := framework.NewDefaultFramework("dra") // The driver containers have to run with sufficient privileges to @@ -404,7 +405,7 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, }).WithTimeout(f.Timeouts.PodDelete).Should(gomega.HaveField("Status.Allocation", (*resourceapi.AllocationResult)(nil))) }) - f.It("must be possible for the driver to update the ResourceClaim.Status.Devices once allocated", feature.DRAResourceClaimDeviceStatus, func(ctx context.Context) { + f.It("must be possible for the driver to update the ResourceClaim.Status.Devices once allocated", feature.DRAResourceClaimDeviceStatus, framework.WithFeatureGate(features.DRAResourceClaimDeviceStatus), framework.WithFeatureGate(features.DynamicResourceAllocation), func(ctx context.Context) { pod := b.podExternal() claim := b.externalClaim() b.create(ctx, claim, pod) @@ -898,7 +899,7 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, driver := NewDriver(f, nodes, networkResources) b := newBuilder(f, driver) - f.It("support validating admission policy for admin access", feature.DRAAdminAccess, func(ctx context.Context) { + f.It("support validating admission policy for admin access", feature.DRAAdminAccess, framework.WithFeatureGate(features.DRAAdminAccess), framework.WithFeatureGate(features.DynamicResourceAllocation), func(ctx context.Context) { // Create VAP, after making it unique to the current test. adminAccessPolicyYAML := strings.ReplaceAll(adminAccessPolicyYAML, "dra.example.com", b.f.UniqueName) driver.createFromYAML(ctx, []byte(adminAccessPolicyYAML), "") @@ -1011,7 +1012,7 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation, gomega.Expect(err).Should(gomega.MatchError(gomega.ContainSubstring("exceeded quota: object-count, requested: count/resourceclaims.resource.k8s.io=1, used: count/resourceclaims.resource.k8s.io=1, limited: count/resourceclaims.resource.k8s.io=1")), "creating second claim not allowed") }) - f.It("DaemonSet with admin access", feature.DRAAdminAccess, func(ctx context.Context) { + f.It("DaemonSet with admin access", feature.DRAAdminAccess, framework.WithFeatureGate(features.DRAAdminAccess), framework.WithFeatureGate(features.DynamicResourceAllocation), func(ctx context.Context) { pod, template := b.podInline() template.Spec.Spec.Devices.Requests[0].AdminAccess = ptr.To(true) // Limit the daemon set to the one node where we have the driver.