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"
@@ -218,7 +219,7 @@ var _ = Describe("Client", func() {
218
219
By ("creating the object a second time" )
219
220
err = cl .Create (context .TODO (), old )
220
221
Expect (err ).To (HaveOccurred ())
221
- Expect (err . Error ( )).To (ContainSubstring ( "already exists" ))
222
+ Expect (errors . IsAlreadyExists ( err )).To (BeTrue ( ))
222
223
223
224
close (done )
224
225
})
@@ -338,7 +339,7 @@ var _ = Describe("Client", func() {
338
339
By ("creating the object a second time" )
339
340
err = cl .Create (context .TODO (), u )
340
341
Expect (err ).To (HaveOccurred ())
341
- Expect (err . Error ( )).To (ContainSubstring ( "already exists" ))
342
+ Expect (errors . IsAlreadyExists ( err )).To (BeTrue ( ))
342
343
343
344
close (done )
344
345
})
You can’t perform that action at this time.
0 commit comments