mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 21:12:07 +00:00
Merge pull request #129153 from carlory/e2e-dra
dra e2e tests: add feature-gate label when these tests depend feature-gate
This commit is contained in:
commit
7f6220d7ed
@ -45,6 +45,7 @@ import (
|
|||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/dynamic-resource-allocation/resourceslice"
|
"k8s.io/dynamic-resource-allocation/resourceslice"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
|
"k8s.io/kubernetes/pkg/features"
|
||||||
"k8s.io/kubernetes/test/e2e/feature"
|
"k8s.io/kubernetes/test/e2e/feature"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2edaemonset "k8s.io/kubernetes/test/e2e/framework/daemonset"
|
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")
|
f := framework.NewDefaultFramework("dra")
|
||||||
|
|
||||||
// The driver containers have to run with sufficient privileges to
|
// 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)))
|
}).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()
|
pod := b.podExternal()
|
||||||
claim := b.externalClaim()
|
claim := b.externalClaim()
|
||||||
b.create(ctx, claim, pod)
|
b.create(ctx, claim, pod)
|
||||||
@ -898,7 +899,7 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation,
|
|||||||
driver := NewDriver(f, nodes, networkResources)
|
driver := NewDriver(f, nodes, networkResources)
|
||||||
b := newBuilder(f, driver)
|
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.
|
// Create VAP, after making it unique to the current test.
|
||||||
adminAccessPolicyYAML := strings.ReplaceAll(adminAccessPolicyYAML, "dra.example.com", b.f.UniqueName)
|
adminAccessPolicyYAML := strings.ReplaceAll(adminAccessPolicyYAML, "dra.example.com", b.f.UniqueName)
|
||||||
driver.createFromYAML(ctx, []byte(adminAccessPolicyYAML), "")
|
driver.createFromYAML(ctx, []byte(adminAccessPolicyYAML), "")
|
||||||
@ -1017,7 +1018,7 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation,
|
|||||||
}).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")
|
}).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()
|
pod, template := b.podInline()
|
||||||
template.Spec.Spec.Devices.Requests[0].AdminAccess = ptr.To(true)
|
template.Spec.Spec.Devices.Requests[0].AdminAccess = ptr.To(true)
|
||||||
// Limit the daemon set to the one node where we have the driver.
|
// Limit the daemon set to the one node where we have the driver.
|
||||||
|
Loading…
Reference in New Issue
Block a user