@@ -138,8 +138,14 @@ def test_create_apiservice_from_yaml_with_conflict(self):
138138 utils .create_from_yaml (
139139 k8s_client , "kubernetes/e2e_test/test_yaml/api-service.yaml" )
140140 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 '
143149 )
144150 self .assertEqual (exp_error , str (cm .exception ))
145151 reg_api .delete_api_service (
@@ -270,8 +276,11 @@ def test_create_from_multi_resource_yaml_with_conflict(self):
270276 with self .assertRaises (utils .FailToCreateError ) as cm :
271277 utils .create_from_yaml (
272278 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 '
275284 )
276285 self .assertEqual (exp_error , str (cm .exception ))
277286 ctr = core_api .read_namespaced_replication_controller (
@@ -292,9 +301,12 @@ def test_create_from_multi_resource_yaml_with_multi_conflicts(self):
292301 with self .assertRaises (utils .FailToCreateError ) as cm :
293302 utils .create_from_yaml (
294303 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 '
298310 )
299311 exp_error += exp_error
300312 self .assertEqual (exp_error , str (cm .exception ))
0 commit comments