Merge pull request #120305 from Rei1010/cleanUp

e2e_scheduling:stop using deprecated framework.ExpectError
This commit is contained in:
Kubernetes Prow Robot 2023-09-04 04:49:59 -07:00 committed by GitHub
commit 6586296afc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -163,12 +163,12 @@ var _ = SIGDescribe("LimitRange", func() {
ginkgo.By("Failing to create a Pod with less than min resources")
pod = newTestPod(podName, getResourceList("10m", "50Mi", "50Gi"), v1.ResourceList{})
_, err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(ctx, pod, metav1.CreateOptions{})
framework.ExpectError(err)
gomega.Expect(err).To(gomega.HaveOccurred())
ginkgo.By("Failing to create a Pod with more than max resources")
pod = newTestPod(podName, getResourceList("600m", "600Mi", "600Gi"), v1.ResourceList{})
_, err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(ctx, pod, metav1.CreateOptions{})
framework.ExpectError(err)
gomega.Expect(err).To(gomega.HaveOccurred())
ginkgo.By("Updating a LimitRange")
newMin := getResourceList("9m", "49Mi", "49Gi")
@ -192,7 +192,7 @@ var _ = SIGDescribe("LimitRange", func() {
ginkgo.By("Failing to create a Pod with more than max resources")
pod = newTestPod(podName, getResourceList("600m", "600Mi", "600Gi"), v1.ResourceList{})
_, err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(ctx, pod, metav1.CreateOptions{})
framework.ExpectError(err)
gomega.Expect(err).To(gomega.HaveOccurred())
ginkgo.By("Deleting a LimitRange")
err = f.ClientSet.CoreV1().LimitRanges(f.Namespace.Name).Delete(ctx, limitRange.Name, *metav1.NewDeleteOptions(30))

View File

@ -814,13 +814,13 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() {
pcCopy := pcs[0].DeepCopy()
pcCopy.Value = pcCopy.Value * 10
err := patchPriorityClass(ctx, cs, pcs[0], pcCopy)
framework.ExpectError(err, "expect a patch error on an immutable field")
gomega.Expect(err).To(gomega.HaveOccurred(), "expect a patch error on an immutable field")
framework.Logf("%v", err)
pcCopy = pcs[1].DeepCopy()
pcCopy.Value = pcCopy.Value * 10
_, err = cs.SchedulingV1().PriorityClasses().Update(ctx, pcCopy, metav1.UpdateOptions{})
framework.ExpectError(err, "expect an update error on an immutable field")
gomega.Expect(err).To(gomega.HaveOccurred(), "expect an update error on an immutable field")
framework.Logf("%v", err)
// 2. Patch/Update on mutable fields will succeed.