File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import (
25
25
. "github.com/onsi/gomega"
26
26
appsv1 "k8s.io/api/apps/v1"
27
27
corev1 "k8s.io/api/core/v1"
28
+ "k8s.io/apimachinery/pkg/api/errors"
28
29
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
29
30
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
30
31
"k8s.io/apimachinery/pkg/runtime"
@@ -216,7 +217,7 @@ var _ = Describe("Client", func() {
216
217
By ("creating the object a second time" )
217
218
err = cl .Create (context .TODO (), old )
218
219
Expect (err ).To (HaveOccurred ())
219
- Expect (err . Error ( )).To (ContainSubstring ( "already exists" ))
220
+ Expect (errors . IsAlreadyExists ( err )).To (BeTrue ( ))
220
221
221
222
close (done )
222
223
})
@@ -337,7 +338,7 @@ var _ = Describe("Client", func() {
337
338
By ("creating the object a second time" )
338
339
err = cl .Create (context .TODO (), u )
339
340
Expect (err ).To (HaveOccurred ())
340
- Expect (err . Error ( )).To (ContainSubstring ( "already exists" ))
341
+ Expect (errors . IsAlreadyExists ( err )).To (BeTrue ( ))
341
342
342
343
close (done )
343
344
})
You can’t perform that action at this time.
0 commit comments