@@ -52,21 +52,6 @@ def test_create_apps_deployment_from_yaml(self):
52
52
name = "nginx-app" , namespace = "default" ,
53
53
body = {})
54
54
55
- def test_create_extensions_deployment_from_yaml (self ):
56
- """
57
- Should be able to create an extensions/v1beta1 deployment.
58
- """
59
- k8s_client = client .api_client .ApiClient (configuration = self .config )
60
- utils .create_from_yaml (
61
- k8s_client , self .path_prefix + "extensions-deployment.yaml" )
62
- ext_api = client .ExtensionsV1beta1Api (k8s_client )
63
- dep = ext_api .read_namespaced_deployment (name = "nginx-deployment" ,
64
- namespace = "default" )
65
- self .assertIsNotNone (dep )
66
- ext_api .delete_namespaced_deployment (
67
- name = "nginx-deployment" , namespace = "default" ,
68
- body = {})
69
-
70
55
def test_create_pod_from_yaml (self ):
71
56
"""
72
57
Should be able to create a pod.
@@ -134,7 +119,7 @@ def test_create_deployment_non_default_namespace_from_yaml(self):
134
119
utils .create_from_yaml (
135
120
k8s_client , self .path_prefix + "dep-deployment.yaml" )
136
121
core_api = client .CoreV1Api (k8s_client )
137
- ext_api = client .ExtensionsV1beta1Api (k8s_client )
122
+ ext_api = client .AppsV1Api (k8s_client )
138
123
nmsp = core_api .read_namespace (name = "dep" )
139
124
self .assertIsNotNone (nmsp )
140
125
dep = ext_api .read_namespaced_deployment (name = "nginx-deployment" ,
@@ -186,7 +171,7 @@ def test_create_general_list_from_yaml(self):
186
171
utils .create_from_yaml (
187
172
k8s_client , self .path_prefix + "list.yaml" )
188
173
core_api = client .CoreV1Api (k8s_client )
189
- ext_api = client .ExtensionsV1beta1Api (k8s_client )
174
+ ext_api = client .AppsV1Api (k8s_client )
190
175
svc = core_api .read_namespaced_service (name = "list-service-test" ,
191
176
namespace = "default" )
192
177
self .assertIsNotNone (svc )
@@ -317,7 +302,7 @@ def test_create_from_multi_resource_yaml_with_conflict(self):
317
302
318
303
def test_create_from_multi_resource_yaml_with_multi_conflicts (self ):
319
304
"""
320
- Should create an extensions/v1beta1 deployment
305
+ Should create an apps/v1 deployment
321
306
and fail to create the same deployment twice.
322
307
Should raise an exception that contains two error messages.
323
308
"""
@@ -327,14 +312,14 @@ def test_create_from_multi_resource_yaml_with_multi_conflicts(self):
327
312
k8s_client , self .path_prefix + "triple-nginx.yaml" )
328
313
exp_error = ('Error from server (Conflict): {"kind":"Status",'
329
314
'"apiVersion":"v1","metadata":{},"status":"Failure",'
330
- '"message":"deployments.extensions \\ "triple-nginx\\ " '
315
+ '"message":"deployments.apps \\ "triple-nginx\\ " '
331
316
'already exists","reason":"AlreadyExists",'
332
- '"details":{"name":"triple-nginx","group":"extensions ",'
317
+ '"details":{"name":"triple-nginx","group":"apps ",'
333
318
'"kind":"deployments"},"code":409}\n '
334
319
)
335
320
exp_error += exp_error
336
321
self .assertEqual (exp_error , str (cm .exception ))
337
- ext_api = client .ExtensionsV1beta1Api (k8s_client )
322
+ ext_api = client .AppsV1Api (k8s_client )
338
323
dep = ext_api .read_namespaced_deployment (name = "triple-nginx" ,
339
324
namespace = "default" )
340
325
self .assertIsNotNone (dep )
@@ -348,7 +333,8 @@ def test_create_namespaces_apps_deployment_from_yaml(self):
348
333
"""
349
334
k8s_client = client .api_client .ApiClient (configuration = self .config )
350
335
utils .create_from_yaml (
351
- k8s_client , self .path_prefix + "apps-deployment.yaml" , namespace = self .test_namespace )
336
+ k8s_client , self .path_prefix + "apps-deployment.yaml" ,
337
+ namespace = self .test_namespace )
352
338
app_api = client .AppsV1beta1Api (k8s_client )
353
339
dep = app_api .read_namespaced_deployment (name = "nginx-app" ,
354
340
namespace = self .test_namespace )
@@ -357,14 +343,15 @@ def test_create_namespaces_apps_deployment_from_yaml(self):
357
343
name = "nginx-app" , namespace = self .test_namespace ,
358
344
body = {})
359
345
360
- def test_create_from_list_in_multi_resource_yaml (self ):
346
+ def test_create_from_list_in_multi_resource_yaml_namespaced (self ):
361
347
"""
362
348
Should be able to create the items in the PodList and a deployment
363
- specified in the multi-resource file
349
+ specified in the multi-resource file in a test namespace
364
350
"""
365
351
k8s_client = client .api_client .ApiClient (configuration = self .config )
366
352
utils .create_from_yaml (
367
- k8s_client , self .path_prefix + "multi-resource-with-list.yaml" , namespace = self .test_namespace )
353
+ k8s_client , self .path_prefix + "multi-resource-with-list.yaml" ,
354
+ namespace = self .test_namespace )
368
355
core_api = client .CoreV1Api (k8s_client )
369
356
app_api = client .AppsV1beta1Api (k8s_client )
370
357
pod_0 = core_api .read_namespaced_pod (
0 commit comments