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