@@ -170,7 +170,8 @@ func doPodResizeAdmissionPluginsTests() {
170
170
ginkgo .By ("patching pod for resize with memory exceeding resource quota" )
171
171
_ , pErrExceedMemory := f .ClientSet .CoreV1 ().Pods (resizedPod .Namespace ).Patch (ctx ,
172
172
resizedPod .Name , types .StrategicMergePatchType , []byte (patchStringExceedMemory ), metav1.PatchOptions {}, "resize" )
173
- gomega .Expect (pErrExceedMemory ).To (gomega .HaveOccurred (), tc .wantMemoryError )
173
+ gomega .Expect (pErrExceedMemory ).To (gomega .HaveOccurred ())
174
+ gomega .Expect (pErrExceedMemory ).To (gomega .MatchError (gomega .ContainSubstring (tc .wantMemoryError )))
174
175
175
176
ginkgo .By ("verifying pod patched for resize exceeding memory resource quota remains unchanged" )
176
177
patchedPodExceedMemory , pErrEx2 := podClient .Get (ctx , resizedPod .Name , metav1.GetOptions {})
@@ -181,7 +182,8 @@ func doPodResizeAdmissionPluginsTests() {
181
182
ginkgo .By (fmt .Sprintf ("patching pod %s for resize with CPU exceeding resource quota" , resizedPod .Name ))
182
183
_ , pErrExceedCPU := f .ClientSet .CoreV1 ().Pods (resizedPod .Namespace ).Patch (ctx ,
183
184
resizedPod .Name , types .StrategicMergePatchType , []byte (patchStringExceedCPU ), metav1.PatchOptions {}, "resize" )
184
- gomega .Expect (pErrExceedCPU ).To (gomega .HaveOccurred (), tc .wantCPUError )
185
+ gomega .Expect (pErrExceedCPU ).To (gomega .HaveOccurred ())
186
+ gomega .Expect (pErrExceedCPU ).To (gomega .MatchError (gomega .ContainSubstring (tc .wantCPUError )))
185
187
186
188
ginkgo .By ("verifying pod patched for resize exceeding CPU resource quota remains unchanged" )
187
189
patchedPodExceedCPU , pErrEx1 := podClient .Get (ctx , resizedPod .Name , metav1.GetOptions {})
0 commit comments