@@ -138,8 +138,14 @@ def test_create_apiservice_from_yaml_with_conflict(self):
138
138
utils .create_from_yaml (
139
139
k8s_client , "kubernetes/e2e_test/test_yaml/api-service.yaml" )
140
140
exp_error = ('Error from server (Conflict): '
141
- 'apiservices.apiregistration.k8s.io '
142
- '"v1alpha1.wardle.k8s.io" already exists\n '
141
+ '{"kind":"Status","apiVersion":"v1","metadata":{},'
142
+ '"status":"Failure",'
143
+ '"message":"apiservices.apiregistration.k8s.io '
144
+ '\\ "v1alpha1.wardle.k8s.io\\ " already exists",'
145
+ '"reason":"AlreadyExists",'
146
+ '"details":{"name":"v1alpha1.wardle.k8s.io",'
147
+ '"group":"apiregistration.k8s.io","kind":"apiservices"},'
148
+ '"code":409}\n '
143
149
)
144
150
self .assertEqual (exp_error , str (cm .exception ))
145
151
reg_api .delete_api_service (
@@ -270,8 +276,11 @@ def test_create_from_multi_resource_yaml_with_conflict(self):
270
276
with self .assertRaises (utils .FailToCreateError ) as cm :
271
277
utils .create_from_yaml (
272
278
k8s_client , self .path_prefix + "yaml-conflict-multi.yaml" )
273
- exp_error = ('Error from server (Conflict): '
274
- 'services "mock-2" already exists\n '
279
+ exp_error = ('Error from server (Conflict): {"kind":"Status",'
280
+ '"apiVersion":"v1","metadata":{},"status":"Failure",'
281
+ '"message":"services \\ "mock-2\\ " already exists",'
282
+ '"reason":"AlreadyExists","details":{"name":"mock-2",'
283
+ '"kind":"services"},"code":409}\n '
275
284
)
276
285
self .assertEqual (exp_error , str (cm .exception ))
277
286
ctr = core_api .read_namespaced_replication_controller (
@@ -292,9 +301,12 @@ def test_create_from_multi_resource_yaml_with_multi_conflicts(self):
292
301
with self .assertRaises (utils .FailToCreateError ) as cm :
293
302
utils .create_from_yaml (
294
303
k8s_client , self .path_prefix + "triple-nginx.yaml" )
295
- exp_error = ('Error from server (Conflict): '
296
- 'deployments.extensions "triple-nginx" '
297
- 'already exists\n '
304
+ exp_error = ('Error from server (Conflict): {"kind":"Status",'
305
+ '"apiVersion":"v1","metadata":{},"status":"Failure",'
306
+ '"message":"deployments.extensions \\ "triple-nginx\\ " '
307
+ 'already exists","reason":"AlreadyExists",'
308
+ '"details":{"name":"triple-nginx","group":"extensions",'
309
+ '"kind":"deployments"},"code":409}\n '
298
310
)
299
311
exp_error += exp_error
300
312
self .assertEqual (exp_error , str (cm .exception ))
0 commit comments