@@ -216,7 +216,7 @@ var _ = SIGDescribe("ResourceQuota", func() {
216
216
requests [v1 .ResourceMemory ] = resource .MustParse ("100Mi" )
217
217
pod = newTestPodForQuota (f , "fail-pod" , requests , v1.ResourceList {})
218
218
pod , err = f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).Create (pod )
219
- gomega . Expect (err ). To ( gomega . HaveOccurred () )
219
+ framework . ExpectError (err )
220
220
221
221
ginkgo .By ("Not allowing a pod to be created that exceeds remaining quota(validation on extended resources)" )
222
222
requests = v1.ResourceList {}
@@ -228,7 +228,7 @@ var _ = SIGDescribe("ResourceQuota", func() {
228
228
limits [v1 .ResourceName (extendedResourceName )] = resource .MustParse ("2" )
229
229
pod = newTestPodForQuota (f , "fail-pod-for-extended-resource" , requests , limits )
230
230
pod , err = f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).Create (pod )
231
- gomega . Expect (err ). To ( gomega . HaveOccurred () )
231
+ framework . ExpectError (err )
232
232
233
233
ginkgo .By ("Ensuring a pod cannot update its resource requirements" )
234
234
// a pod cannot dynamically update its resource requirements.
@@ -238,7 +238,7 @@ var _ = SIGDescribe("ResourceQuota", func() {
238
238
requests [v1 .ResourceEphemeralStorage ] = resource .MustParse ("10Gi" )
239
239
podToUpdate .Spec .Containers [0 ].Resources .Requests = requests
240
240
_ , err = f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).Update (podToUpdate )
241
- gomega . Expect (err ). To ( gomega . HaveOccurred () )
241
+ framework . ExpectError (err )
242
242
243
243
ginkgo .By ("Ensuring attempts to update pod resource requirements did not change quota usage" )
244
244
err = waitForResourceQuota (f .ClientSet , f .Namespace .Name , quotaName , usedResources )
@@ -561,7 +561,7 @@ var _ = SIGDescribe("ResourceQuota", func() {
561
561
},
562
562
}, resourceClient , testcrd .Crd )
563
563
// since we only give one quota, this creation should fail.
564
- gomega . Expect (err ). To ( gomega . HaveOccurred () )
564
+ framework . ExpectError (err )
565
565
566
566
ginkgo .By ("Deleting a custom resource" )
567
567
err = deleteCustomResource (resourceClient , testcr .GetName ())
@@ -1052,7 +1052,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() {
1052
1052
podName2 := "testpod-pclass2-2"
1053
1053
pod2 := newTestPodForQuotaWithPriority (f , podName2 , v1.ResourceList {}, v1.ResourceList {}, "pclass2" )
1054
1054
pod2 , err = f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).Create (pod2 )
1055
- gomega . Expect (err ). To ( gomega . HaveOccurred () )
1055
+ framework . ExpectError (err )
1056
1056
1057
1057
ginkgo .By ("Deleting first pod" )
1058
1058
err = f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).Delete (pod .Name , metav1 .NewDeleteOptions (0 ))
0 commit comments