@@ -76,21 +76,6 @@ def test_create_apps_deployment_from_yaml_obj(self):
76
76
name = "nginx-app-3" , namespace = "default" ,
77
77
body = {})
78
78
79
- def test_create_extensions_deployment_from_yaml (self ):
80
- """
81
- Should be able to create an extensions/v1beta1 deployment.
82
- """
83
- k8s_client = client .api_client .ApiClient (configuration = self .config )
84
- utils .create_from_yaml (
85
- k8s_client , self .path_prefix + "extensions-deployment.yaml" )
86
- ext_api = client .ExtensionsV1beta1Api (k8s_client )
87
- dep = ext_api .read_namespaced_deployment (name = "nginx-deployment" ,
88
- namespace = "default" )
89
- self .assertIsNotNone (dep )
90
- ext_api .delete_namespaced_deployment (
91
- name = "nginx-deployment" , namespace = "default" ,
92
- body = {})
93
-
94
79
def test_create_pod_from_yaml (self ):
95
80
"""
96
81
Should be able to create a pod.
@@ -172,7 +157,7 @@ def test_create_deployment_non_default_namespace_from_yaml(self):
172
157
utils .create_from_yaml (
173
158
k8s_client , self .path_prefix + "dep-deployment.yaml" )
174
159
core_api = client .CoreV1Api (k8s_client )
175
- ext_api = client .ExtensionsV1beta1Api (k8s_client )
160
+ ext_api = client .AppsV1Api (k8s_client )
176
161
nmsp = core_api .read_namespace (name = "dep" )
177
162
self .assertIsNotNone (nmsp )
178
163
dep = ext_api .read_namespaced_deployment (name = "nginx-deployment" ,
@@ -224,7 +209,7 @@ def test_create_general_list_from_yaml(self):
224
209
utils .create_from_yaml (
225
210
k8s_client , self .path_prefix + "list.yaml" )
226
211
core_api = client .CoreV1Api (k8s_client )
227
- ext_api = client .ExtensionsV1beta1Api (k8s_client )
212
+ ext_api = client .AppsV1Api (k8s_client )
228
213
svc = core_api .read_namespaced_service (name = "list-service-test" ,
229
214
namespace = "default" )
230
215
self .assertIsNotNone (svc )
@@ -355,7 +340,7 @@ def test_create_from_multi_resource_yaml_with_conflict(self):
355
340
356
341
def test_create_from_multi_resource_yaml_with_multi_conflicts (self ):
357
342
"""
358
- Should create an extensions/v1beta1 deployment
343
+ Should create an apps/v1 deployment
359
344
and fail to create the same deployment twice.
360
345
Should raise an exception that contains two error messages.
361
346
"""
@@ -365,14 +350,14 @@ def test_create_from_multi_resource_yaml_with_multi_conflicts(self):
365
350
k8s_client , self .path_prefix + "triple-nginx.yaml" )
366
351
exp_error = ('Error from server (Conflict): {"kind":"Status",'
367
352
'"apiVersion":"v1","metadata":{},"status":"Failure",'
368
- '"message":"deployments.extensions \\ "triple-nginx\\ " '
353
+ '"message":"deployments.apps \\ "triple-nginx\\ " '
369
354
'already exists","reason":"AlreadyExists",'
370
- '"details":{"name":"triple-nginx","group":"extensions ",'
355
+ '"details":{"name":"triple-nginx","group":"apps ",'
371
356
'"kind":"deployments"},"code":409}\n '
372
357
)
373
358
exp_error += exp_error
374
359
self .assertEqual (exp_error , str (cm .exception ))
375
- ext_api = client .ExtensionsV1beta1Api (k8s_client )
360
+ ext_api = client .AppsV1Api (k8s_client )
376
361
dep = ext_api .read_namespaced_deployment (name = "triple-nginx" ,
377
362
namespace = "default" )
378
363
self .assertIsNotNone (dep )
@@ -386,7 +371,8 @@ def test_create_namespaces_apps_deployment_from_yaml(self):
386
371
"""
387
372
k8s_client = client .api_client .ApiClient (configuration = self .config )
388
373
utils .create_from_yaml (
389
- k8s_client , self .path_prefix + "apps-deployment.yaml" , namespace = self .test_namespace )
374
+ k8s_client , self .path_prefix + "apps-deployment.yaml" ,
375
+ namespace = self .test_namespace )
390
376
app_api = client .AppsV1beta1Api (k8s_client )
391
377
dep = app_api .read_namespaced_deployment (name = "nginx-app" ,
392
378
namespace = self .test_namespace )
@@ -395,14 +381,15 @@ def test_create_namespaces_apps_deployment_from_yaml(self):
395
381
name = "nginx-app" , namespace = self .test_namespace ,
396
382
body = {})
397
383
398
- def test_create_from_list_in_multi_resource_yaml (self ):
384
+ def test_create_from_list_in_multi_resource_yaml_namespaced (self ):
399
385
"""
400
386
Should be able to create the items in the PodList and a deployment
401
- specified in the multi-resource file
387
+ specified in the multi-resource file in a test namespace
402
388
"""
403
389
k8s_client = client .api_client .ApiClient (configuration = self .config )
404
390
utils .create_from_yaml (
405
- k8s_client , self .path_prefix + "multi-resource-with-list.yaml" , namespace = self .test_namespace )
391
+ k8s_client , self .path_prefix + "multi-resource-with-list.yaml" ,
392
+ namespace = self .test_namespace )
406
393
core_api = client .CoreV1Api (k8s_client )
407
394
app_api = client .AppsV1beta1Api (k8s_client )
408
395
pod_0 = core_api .read_namespaced_pod (
0 commit comments