mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
replace test error checking with more readable way
This commit is contained in:
parent
15a4342fe8
commit
4cb4864487
@ -130,12 +130,12 @@ var _ = SIGDescribe("LimitRange", func() {
|
|||||||
ginkgo.By("Failing to create a Pod with less than min resources")
|
ginkgo.By("Failing to create a Pod with less than min resources")
|
||||||
pod = f.NewTestPod(podName, getResourceList("10m", "50Mi", "50Gi"), v1.ResourceList{})
|
pod = f.NewTestPod(podName, getResourceList("10m", "50Mi", "50Gi"), v1.ResourceList{})
|
||||||
pod, err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(pod)
|
pod, err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(pod)
|
||||||
gomega.Expect(err).To(gomega.HaveOccurred())
|
framework.ExpectError(err)
|
||||||
|
|
||||||
ginkgo.By("Failing to create a Pod with more than max resources")
|
ginkgo.By("Failing to create a Pod with more than max resources")
|
||||||
pod = f.NewTestPod(podName, getResourceList("600m", "600Mi", "600Gi"), v1.ResourceList{})
|
pod = f.NewTestPod(podName, getResourceList("600m", "600Mi", "600Gi"), v1.ResourceList{})
|
||||||
pod, err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(pod)
|
pod, err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(pod)
|
||||||
gomega.Expect(err).To(gomega.HaveOccurred())
|
framework.ExpectError(err)
|
||||||
|
|
||||||
ginkgo.By("Updating a LimitRange")
|
ginkgo.By("Updating a LimitRange")
|
||||||
newMin := getResourceList("9m", "49Mi", "49Gi")
|
newMin := getResourceList("9m", "49Mi", "49Gi")
|
||||||
@ -158,7 +158,7 @@ var _ = SIGDescribe("LimitRange", func() {
|
|||||||
ginkgo.By("Failing to create a Pod with more than max resources")
|
ginkgo.By("Failing to create a Pod with more than max resources")
|
||||||
pod = f.NewTestPod(podName, getResourceList("600m", "600Mi", "600Gi"), v1.ResourceList{})
|
pod = f.NewTestPod(podName, getResourceList("600m", "600Mi", "600Gi"), v1.ResourceList{})
|
||||||
pod, err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(pod)
|
pod, err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(pod)
|
||||||
gomega.Expect(err).To(gomega.HaveOccurred())
|
framework.ExpectError(err)
|
||||||
|
|
||||||
ginkgo.By("Deleting a LimitRange")
|
ginkgo.By("Deleting a LimitRange")
|
||||||
err = f.ClientSet.CoreV1().LimitRanges(f.Namespace.Name).Delete(limitRange.Name, metav1.NewDeleteOptions(30))
|
err = f.ClientSet.CoreV1().LimitRanges(f.Namespace.Name).Delete(limitRange.Name, metav1.NewDeleteOptions(30))
|
||||||
|
Loading…
Reference in New Issue
Block a user