mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Don't set default resize policy in E2E tests
This commit is contained in:
parent
da4dc0aec7
commit
7c3a9d65fc
@ -941,8 +941,6 @@ func doPodResizeTests(f *framework.Framework) {
|
||||
var pErr error
|
||||
|
||||
tStamp := strconv.Itoa(time.Now().Nanosecond())
|
||||
e2epod.InitDefaultResizePolicy(tc.containers)
|
||||
e2epod.InitDefaultResizePolicy(tc.expected)
|
||||
testPod = e2epod.MakePodWithResizableContainers(f.Namespace.Name, "", tStamp, tc.containers)
|
||||
testPod.GenerateName = "resize-test-"
|
||||
testPod = e2epod.MustMixinRestrictedPodSecurity(testPod)
|
||||
@ -1128,8 +1126,6 @@ func doPodResizeErrorTests(f *framework.Framework) {
|
||||
var pErr error
|
||||
|
||||
tStamp := strconv.Itoa(time.Now().Nanosecond())
|
||||
e2epod.InitDefaultResizePolicy(tc.containers)
|
||||
e2epod.InitDefaultResizePolicy(tc.expected)
|
||||
testPod = e2epod.MakePodWithResizableContainers(f.Namespace.Name, "testpod", tStamp, tc.containers)
|
||||
testPod = e2epod.MustMixinRestrictedPodSecurity(testPod)
|
||||
|
||||
|
@ -142,21 +142,6 @@ func getTestResourceInfo(tcInfo ResizableContainerInfo) (res v1.ResourceRequirem
|
||||
return res, resizePol
|
||||
}
|
||||
|
||||
func InitDefaultResizePolicy(containers []ResizableContainerInfo) {
|
||||
noRestart := v1.NotRequired
|
||||
setDefaultPolicy := func(ci *ResizableContainerInfo) {
|
||||
if ci.CPUPolicy == nil {
|
||||
ci.CPUPolicy = &noRestart
|
||||
}
|
||||
if ci.MemPolicy == nil {
|
||||
ci.MemPolicy = &noRestart
|
||||
}
|
||||
}
|
||||
for i := range containers {
|
||||
setDefaultPolicy(&containers[i])
|
||||
}
|
||||
}
|
||||
|
||||
func makeResizableContainer(tcInfo ResizableContainerInfo) v1.Container {
|
||||
cmd := "grep Cpus_allowed_list /proc/self/status | cut -f2 && sleep 1d"
|
||||
res, resizePol := getTestResourceInfo(tcInfo)
|
||||
|
@ -138,8 +138,6 @@ func doPodResizeAdmissionPluginsTests() {
|
||||
tc.enableAdmissionPlugin(ctx, f)
|
||||
|
||||
tStamp := strconv.Itoa(time.Now().Nanosecond())
|
||||
e2epod.InitDefaultResizePolicy(containers)
|
||||
e2epod.InitDefaultResizePolicy(expected)
|
||||
testPod1 := e2epod.MakePodWithResizableContainers(f.Namespace.Name, "testpod1", tStamp, containers)
|
||||
testPod1 = e2epod.MustMixinRestrictedPodSecurity(testPod1)
|
||||
testPod2 := e2epod.MakePodWithResizableContainers(f.Namespace.Name, "testpod2", tStamp, containers)
|
||||
@ -267,8 +265,6 @@ func doPodResizeSchedulerTests(f *framework.Framework) {
|
||||
}`, testPod2CPUQuantityResized.MilliValue(), testPod2CPUQuantityResized.MilliValue())
|
||||
|
||||
tStamp := strconv.Itoa(time.Now().Nanosecond())
|
||||
e2epod.InitDefaultResizePolicy(c1)
|
||||
e2epod.InitDefaultResizePolicy(c2)
|
||||
testPod1 := e2epod.MakePodWithResizableContainers(f.Namespace.Name, "testpod1", tStamp, c1)
|
||||
testPod1 = e2epod.MustMixinRestrictedPodSecurity(testPod1)
|
||||
testPod2 := e2epod.MakePodWithResizableContainers(f.Namespace.Name, "testpod2", tStamp, c2)
|
||||
@ -324,7 +320,6 @@ func doPodResizeSchedulerTests(f *framework.Framework) {
|
||||
}`, testPod1CPUQuantityResized.MilliValue(), testPod1CPUQuantityResized.MilliValue())
|
||||
|
||||
tStamp = strconv.Itoa(time.Now().Nanosecond())
|
||||
e2epod.InitDefaultResizePolicy(c3)
|
||||
testPod3 := e2epod.MakePodWithResizableContainers(f.Namespace.Name, "testpod3", tStamp, c3)
|
||||
testPod3 = e2epod.MustMixinRestrictedPodSecurity(testPod3)
|
||||
e2epod.SetNodeAffinity(&testPod3.Spec, node.Name)
|
||||
|
Loading…
Reference in New Issue
Block a user