2 # Licensed under the Apache License, Version 2.0 (the "License"); you may
3 # not use this file except in compliance with the License. You may obtain
4 # a copy of the License at
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 # License for the specific language governing permissions and limitations
14 # For those usages not covered by the Apache License, Version 2.0 please
15 # contact: alfonso.tiernosepulveda@telefonica.com
21 from asynctest
.mock
import Mock
22 from osm_common
.dbmemory
import DbMemory
23 from osm_common
.fslocal
import FsLocal
24 from n2vc
.k8s_helm_conn
import K8sHelmConnector
26 __author__
= "Isabel Lloret <illoret@indra.es>"
29 class TestK8sHelmConn(asynctest
.TestCase
):
30 logging
.basicConfig(level
=logging
.DEBUG
)
31 logger
= logging
.getLogger(__name__
)
32 logger
.setLevel(logging
.DEBUG
)
34 async def setUp(self
):
35 self
.db
= Mock(DbMemory())
36 self
.fs
= asynctest
.Mock(FsLocal())
37 self
.fs
.path
= "./tmp/"
38 self
.namespace
= "testk8s"
39 self
.service_account
= "osm"
40 self
.cluster_id
= "helm_cluster_id"
41 self
.cluster_uuid
= self
.cluster_id
42 # pass fake kubectl and helm commands to make sure it does not call actual commands
43 K8sHelmConnector
._check
_file
_exists
= asynctest
.Mock(return_value
=True)
44 K8sHelmConnector
._local
_async
_exec
= asynctest
.CoroutineMock(
47 cluster_dir
= self
.fs
.path
+ self
.cluster_id
48 self
.kube_config
= self
.fs
.path
+ self
.cluster_id
+ "/.kube/config"
49 self
.helm_home
= self
.fs
.path
+ self
.cluster_id
+ "/.helm"
51 "HELM_HOME": "{}/.helm".format(cluster_dir
),
52 "KUBECONFIG": "{}/.kube/config".format(cluster_dir
),
54 self
.helm_conn
= K8sHelmConnector(self
.fs
, self
.db
, log
=self
.logger
)
55 self
.logger
.debug("Set up executed")
57 @asynctest.fail_on(active_handles
=True)
58 async def test_init_env(self
):
62 @asynctest.fail_on(active_handles
=True)
63 async def test_repo_add(self
):
65 repo_url
= "https://charts.bitnami.com/bitnami"
66 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
68 await self
.helm_conn
.repo_add(self
.cluster_uuid
, repo_name
, repo_url
)
70 self
.helm_conn
.fs
.sync
.assert_called_once_with(from_path
=self
.cluster_id
)
71 self
.helm_conn
.fs
.reverse_sync
.assert_called_once_with(
72 from_path
=self
.cluster_id
75 self
.helm_conn
._local
_async
_exec
.call_count
,
77 "local_async_exec expected 2 calls, called {}".format(
78 self
.helm_conn
._local
_async
_exec
.call_count
82 repo_update_command
= (
83 "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm repo update {}"
86 "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm repo add {} {}"
87 ).format(repo_name
, repo_url
)
88 calls
= self
.helm_conn
._local
_async
_exec
.call_args_list
89 call0_kargs
= calls
[0][1]
91 call0_kargs
.get("command"),
93 "Invalid repo add command: {}".format(call0_kargs
.get("command")),
96 call0_kargs
.get("env"),
98 "Invalid env for add command: {}".format(call0_kargs
.get("env")),
100 call1_kargs
= calls
[1][1]
102 call1_kargs
.get("command"),
104 "Invalid repo update command: {}".format(call1_kargs
.get("command")),
107 call1_kargs
.get("env"),
109 "Invalid env for update command: {}".format(call1_kargs
.get("env")),
112 @asynctest.fail_on(active_handles
=True)
113 async def test_repo_list(self
):
114 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
116 await self
.helm_conn
.repo_list(self
.cluster_uuid
)
118 self
.helm_conn
.fs
.sync
.assert_called_once_with(from_path
=self
.cluster_id
)
119 self
.helm_conn
.fs
.reverse_sync
.assert_called_once_with(
120 from_path
=self
.cluster_id
122 command
= "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm repo list --output yaml"
123 self
.helm_conn
._local
_async
_exec
.assert_called_with(
124 command
=command
, env
=self
.env
, raise_exception_on_error
=False
127 @asynctest.fail_on(active_handles
=True)
128 async def test_repo_remove(self
):
129 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
130 repo_name
= "bitnami"
131 await self
.helm_conn
.repo_remove(self
.cluster_uuid
, repo_name
)
133 self
.helm_conn
.fs
.sync
.assert_called_once_with(from_path
=self
.cluster_id
)
134 self
.helm_conn
.fs
.reverse_sync
.assert_called_once_with(
135 from_path
=self
.cluster_id
137 command
= "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm repo remove {}".format(
140 self
.helm_conn
._local
_async
_exec
.assert_called_once_with(
141 command
=command
, env
=self
.env
, raise_exception_on_error
=True
144 @asynctest.fail_on(active_handles
=True)
145 async def test_install(self
):
146 kdu_model
= "stable/openldap:1.2.2"
147 kdu_instance
= "stable-openldap-0005399828"
149 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
150 self
.helm_conn
._status
_kdu
= asynctest
.CoroutineMock(return_value
=None)
151 self
.helm_conn
._store
_status
= asynctest
.CoroutineMock()
152 self
.helm_conn
.generate_kdu_instance_name
= Mock(return_value
=kdu_instance
)
154 await self
.helm_conn
.install(
159 namespace
=self
.namespace
,
163 self
.helm_conn
.fs
.sync
.assert_has_calls(
165 asynctest
.call(from_path
=self
.cluster_id
),
166 asynctest
.call(from_path
=self
.cluster_id
),
169 self
.helm_conn
.fs
.reverse_sync
.assert_has_calls(
171 asynctest
.call(from_path
=self
.cluster_id
),
172 asynctest
.call(from_path
=self
.cluster_id
),
175 self
.helm_conn
._store
_status
.assert_called_with(
176 cluster_id
=self
.cluster_id
,
177 kdu_instance
=kdu_instance
,
178 namespace
=self
.namespace
,
183 "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm install "
184 "--atomic --output yaml --timeout 300 "
185 "--name=stable-openldap-0005399828 --namespace testk8s stable/openldap "
188 self
.helm_conn
._local
_async
_exec
.assert_called_with(
189 command
=command
, env
=self
.env
, raise_exception_on_error
=False
192 @asynctest.fail_on(active_handles
=True)
193 async def test_upgrade(self
):
194 kdu_model
= "stable/openldap:1.2.3"
195 kdu_instance
= "stable-openldap-0005399828"
198 "chart": "openldap-1.2.2",
199 "name": kdu_instance
,
200 "namespace": self
.namespace
,
202 "status": "DEPLOYED",
204 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
205 self
.helm_conn
._store
_status
= asynctest
.CoroutineMock()
206 self
.helm_conn
.get_instance_info
= asynctest
.CoroutineMock(
207 return_value
=instance_info
210 await self
.helm_conn
.upgrade(
211 self
.cluster_uuid
, kdu_instance
, kdu_model
, atomic
=True, db_dict
=db_dict
213 self
.helm_conn
.fs
.sync
.assert_called_with(from_path
=self
.cluster_id
)
214 self
.helm_conn
.fs
.reverse_sync
.assert_has_calls(
216 asynctest
.call(from_path
=self
.cluster_id
),
217 asynctest
.call(from_path
=self
.cluster_id
),
220 self
.helm_conn
._store
_status
.assert_called_with(
221 cluster_id
=self
.cluster_id
,
222 kdu_instance
=kdu_instance
,
223 namespace
=self
.namespace
,
228 "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm upgrade "
229 "--atomic --output yaml --timeout 300 stable-openldap-0005399828 stable/openldap --version 1.2.3"
231 self
.helm_conn
._local
_async
_exec
.assert_called_with(
232 command
=command
, env
=self
.env
, raise_exception_on_error
=False
235 @asynctest.fail_on(active_handles
=True)
236 async def test_scale(self
):
237 kdu_model
= "stable/openldap:1.2.3"
238 kdu_instance
= "stable-openldap-0005399828"
241 "chart": "openldap-1.2.3",
242 "name": kdu_instance
,
243 "namespace": self
.namespace
,
245 "status": "DEPLOYED",
250 "url": "https://kubernetes-charts.storage.googleapis.com/",
254 # Default values for openldap.
255 # This is a YAML-formatted file.
256 # Declare variables to be passed into your templates.
263 self
.helm_conn
.repo_list
= asynctest
.CoroutineMock(return_value
=repo_list
)
264 self
.helm_conn
.values_kdu
= asynctest
.CoroutineMock(return_value
=kdu_values
)
265 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
266 self
.helm_conn
._store
_status
= asynctest
.CoroutineMock()
267 self
.helm_conn
.get_instance_info
= asynctest
.CoroutineMock(
268 return_value
=instance_info
272 await self
.helm_conn
.scale(
277 cluster_uuid
=self
.cluster_uuid
,
282 "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config "
283 "/usr/bin/helm upgrade --atomic --output yaml --set replicaCount=2 "
284 "--timeout 1800s stable-openldap-0005399828 stable/openldap "
287 self
.helm_conn
._local
_async
_exec
.assert_called_once_with(
288 command
=command
, env
=self
.env
, raise_exception_on_error
=False
292 await self
.helm_conn
.scale(
297 cluster_uuid
=self
.cluster_uuid
,
302 "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config "
303 "/usr/bin/helm upgrade --atomic --output yaml --set dummy-app.replicas=3 "
304 "--timeout 1800s stable-openldap-0005399828 stable/openldap "
307 self
.helm_conn
._local
_async
_exec
.assert_called_with(
308 command
=command
, env
=self
.env
, raise_exception_on_error
=False
310 self
.helm_conn
.fs
.reverse_sync
.assert_called_with(from_path
=self
.cluster_id
)
311 self
.helm_conn
._store
_status
.assert_called_with(
312 cluster_id
=self
.cluster_id
,
313 kdu_instance
=kdu_instance
,
314 namespace
=self
.namespace
,
319 @asynctest.fail_on(active_handles
=True)
320 async def test_rollback(self
):
321 kdu_instance
= "stable-openldap-0005399828"
324 "chart": "openldap-1.2.3",
325 "name": kdu_instance
,
326 "namespace": self
.namespace
,
328 "status": "DEPLOYED",
330 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
331 self
.helm_conn
._store
_status
= asynctest
.CoroutineMock()
332 self
.helm_conn
.get_instance_info
= asynctest
.CoroutineMock(
333 return_value
=instance_info
336 await self
.helm_conn
.rollback(
337 self
.cluster_uuid
, kdu_instance
=kdu_instance
, revision
=1, db_dict
=db_dict
339 self
.helm_conn
.fs
.sync
.assert_called_with(from_path
=self
.cluster_id
)
340 self
.helm_conn
.fs
.reverse_sync
.assert_called_once_with(
341 from_path
=self
.cluster_id
343 self
.helm_conn
._store
_status
.assert_called_with(
344 cluster_id
=self
.cluster_id
,
345 kdu_instance
=kdu_instance
,
346 namespace
=self
.namespace
,
348 operation
="rollback",
351 "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config "
352 "/usr/bin/helm rollback stable-openldap-0005399828 1 --wait"
354 self
.helm_conn
._local
_async
_exec
.assert_called_once_with(
355 command
=command
, env
=self
.env
, raise_exception_on_error
=False
358 @asynctest.fail_on(active_handles
=True)
359 async def test_uninstall(self
):
360 kdu_instance
= "stable-openldap-0005399828"
362 "chart": "openldap-1.2.2",
363 "name": kdu_instance
,
364 "namespace": self
.namespace
,
366 "status": "DEPLOYED",
368 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
369 self
.helm_conn
._store
_status
= asynctest
.CoroutineMock()
370 self
.helm_conn
.get_instance_info
= asynctest
.CoroutineMock(
371 return_value
=instance_info
374 await self
.helm_conn
.uninstall(self
.cluster_uuid
, kdu_instance
)
375 self
.helm_conn
.fs
.sync
.assert_called_with(from_path
=self
.cluster_id
)
376 self
.helm_conn
.fs
.reverse_sync
.assert_called_once_with(
377 from_path
=self
.cluster_id
379 command
= "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm delete --purge {}".format(
382 self
.helm_conn
._local
_async
_exec
.assert_called_once_with(
383 command
=command
, env
=self
.env
, raise_exception_on_error
=True
386 @asynctest.fail_on(active_handles
=True)
387 async def test_get_services(self
):
388 kdu_instance
= "test_services_1"
389 service
= {"name": "testservice", "type": "LoadBalancer"}
390 self
.helm_conn
._local
_async
_exec
_pipe
= asynctest
.CoroutineMock(
393 self
.helm_conn
._parse
_services
= Mock(return_value
=["testservice"])
394 self
.helm_conn
._get
_service
= asynctest
.CoroutineMock(return_value
=service
)
396 services
= await self
.helm_conn
.get_services(
397 self
.cluster_uuid
, kdu_instance
, self
.namespace
399 self
.helm_conn
.fs
.sync
.assert_called_once_with(from_path
=self
.cluster_id
)
400 self
.helm_conn
.fs
.reverse_sync
.assert_called_once_with(
401 from_path
=self
.cluster_id
403 self
.helm_conn
._parse
_services
.assert_called_once()
404 command1
= "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm get manifest {} ".format(
407 command2
= "/usr/bin/kubectl get --namespace={} -f -".format(self
.namespace
)
408 self
.helm_conn
._local
_async
_exec
_pipe
.assert_called_once_with(
409 command1
, command2
, env
=self
.env
, raise_exception_on_error
=True
412 services
, [service
], "Invalid service returned from get_service"
415 @asynctest.fail_on(active_handles
=True)
416 async def test_get_service(self
):
417 service_name
= "service1"
419 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
420 await self
.helm_conn
.get_service(
421 self
.cluster_uuid
, service_name
, self
.namespace
424 self
.helm_conn
.fs
.sync
.assert_called_once_with(from_path
=self
.cluster_id
)
425 self
.helm_conn
.fs
.reverse_sync
.assert_called_once_with(
426 from_path
=self
.cluster_id
429 "/usr/bin/kubectl --kubeconfig=./tmp/helm_cluster_id/.kube/config "
430 "--namespace=testk8s get service service1 -o=yaml"
432 self
.helm_conn
._local
_async
_exec
.assert_called_once_with(
433 command
=command
, env
=self
.env
, raise_exception_on_error
=True
436 @asynctest.fail_on(active_handles
=True)
437 async def test_inspect_kdu(self
):
438 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
440 kdu_model
= "stable/openldap:1.2.4"
441 repo_url
= "https://kubernetes-charts.storage.googleapis.com/"
442 await self
.helm_conn
.inspect_kdu(kdu_model
, repo_url
)
445 "/usr/bin/helm inspect openldap --repo "
446 "https://kubernetes-charts.storage.googleapis.com/ "
449 self
.helm_conn
._local
_async
_exec
.assert_called_with(command
=command
)
451 @asynctest.fail_on(active_handles
=True)
452 async def test_help_kdu(self
):
453 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
455 kdu_model
= "stable/openldap:1.2.4"
456 repo_url
= "https://kubernetes-charts.storage.googleapis.com/"
457 await self
.helm_conn
.help_kdu(kdu_model
, repo_url
)
460 "/usr/bin/helm inspect readme openldap --repo "
461 "https://kubernetes-charts.storage.googleapis.com/ "
464 self
.helm_conn
._local
_async
_exec
.assert_called_with(command
=command
)
466 @asynctest.fail_on(active_handles
=True)
467 async def test_values_kdu(self
):
468 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
470 kdu_model
= "stable/openldap:1.2.4"
471 repo_url
= "https://kubernetes-charts.storage.googleapis.com/"
472 await self
.helm_conn
.values_kdu(kdu_model
, repo_url
)
475 "/usr/bin/helm inspect values openldap --repo "
476 "https://kubernetes-charts.storage.googleapis.com/ "
479 self
.helm_conn
._local
_async
_exec
.assert_called_with(command
=command
)
481 @asynctest.fail_on(active_handles
=True)
482 async def test_get_values_kdu(self
):
483 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
485 kdu_instance
= "stable-openldap-0005399828"
486 await self
.helm_conn
.get_values_kdu(
487 kdu_instance
, self
.namespace
, self
.env
["KUBECONFIG"]
491 "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm get values "
492 "stable-openldap-0005399828 --output yaml"
494 self
.helm_conn
._local
_async
_exec
.assert_called_with(command
=command
)
496 @asynctest.fail_on(active_handles
=True)
497 async def test_instances_list(self
):
498 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
500 await self
.helm_conn
.instances_list(self
.cluster_uuid
)
501 self
.helm_conn
.fs
.sync
.assert_called_once_with(from_path
=self
.cluster_id
)
502 self
.helm_conn
.fs
.reverse_sync
.assert_called_once_with(
503 from_path
=self
.cluster_id
505 command
= "/usr/bin/helm list --output yaml"
506 self
.helm_conn
._local
_async
_exec
.assert_called_once_with(
507 command
=command
, env
=self
.env
, raise_exception_on_error
=True
510 @asynctest.fail_on(active_handles
=True)
511 async def test_status_kdu(self
):
512 kdu_instance
= "stable-openldap-0005399828"
513 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
515 await self
.helm_conn
._status
_kdu
(
516 self
.cluster_id
, kdu_instance
, self
.namespace
, yaml_format
=True
519 "env KUBECONFIG=./tmp/helm_cluster_id/.kube/config /usr/bin/helm status {} --output yaml"
520 ).format(kdu_instance
)
521 self
.helm_conn
._local
_async
_exec
.assert_called_once_with(
524 raise_exception_on_error
=True,
525 show_error_log
=False,
528 @asynctest.fail_on(active_handles
=True)
529 async def test_store_status(self
):
530 kdu_instance
= "stable-openldap-0005399828"
534 "description": "Install complete",
537 "notes": "The openldap helm chart has been installed",
541 self
.helm_conn
._status
_kdu
= asynctest
.CoroutineMock(return_value
=status
)
542 self
.helm_conn
.write_app_status_to_db
= asynctest
.CoroutineMock(
546 await self
.helm_conn
._store
_status
(
547 cluster_id
=self
.cluster_id
,
548 kdu_instance
=kdu_instance
,
549 namespace
=self
.namespace
,
553 self
.helm_conn
._status
_kdu
.assert_called_once_with(
554 cluster_id
=self
.cluster_id
,
555 kdu_instance
=kdu_instance
,
556 namespace
=self
.namespace
,
559 self
.helm_conn
.write_app_status_to_db
.assert_called_once_with(
561 status
="Install complete",
562 detailed_status
=str(status
),
566 @asynctest.fail_on(active_handles
=True)
567 async def test_reset_uninstall_false(self
):
568 self
.helm_conn
._uninstall
_sw
= asynctest
.CoroutineMock()
570 await self
.helm_conn
.reset(self
.cluster_uuid
, force
=False, uninstall_sw
=False)
571 self
.helm_conn
.fs
.sync
.assert_called_once_with(from_path
=self
.cluster_id
)
572 self
.helm_conn
.fs
.file_delete
.assert_called_once_with(
573 self
.cluster_id
, ignore_non_exist
=True
575 self
.helm_conn
._uninstall
_sw
.assert_not_called()
577 @asynctest.fail_on(active_handles
=True)
578 async def test_reset_uninstall(self
):
579 kdu_instance
= "stable-openldap-0021099429"
582 "app_version": "2.4.48",
583 "chart": "openldap-1.2.3",
584 "name": kdu_instance
,
585 "namespace": self
.namespace
,
587 "status": "deployed",
588 "updated": "2020-10-30 11:11:20.376744191 +0000 UTC",
591 self
.helm_conn
._get
_namespace
= Mock(return_value
=self
.namespace
)
592 self
.helm_conn
._uninstall
_sw
= asynctest
.CoroutineMock()
593 self
.helm_conn
.instances_list
= asynctest
.CoroutineMock(return_value
=instances
)
594 self
.helm_conn
.uninstall
= asynctest
.CoroutineMock()
596 await self
.helm_conn
.reset(self
.cluster_uuid
, force
=True, uninstall_sw
=True)
597 self
.helm_conn
.fs
.sync
.assert_called_once_with(from_path
=self
.cluster_id
)
598 self
.helm_conn
.fs
.file_delete
.assert_called_once_with(
599 self
.cluster_id
, ignore_non_exist
=True
601 self
.helm_conn
._get
_namespace
.assert_called_once_with(
602 cluster_uuid
=self
.cluster_uuid
604 self
.helm_conn
.instances_list
.assert_called_once_with(
605 cluster_uuid
=self
.cluster_uuid
607 self
.helm_conn
.uninstall
.assert_called_once_with(
608 cluster_uuid
=self
.cluster_uuid
, kdu_instance
=kdu_instance
610 self
.helm_conn
._uninstall
_sw
.assert_called_once_with(
611 cluster_id
=self
.cluster_id
, namespace
=self
.namespace
614 @asynctest.fail_on(active_handles
=True)
615 async def test_uninstall_sw_namespace(self
):
616 self
.helm_conn
._local
_async
_exec
= asynctest
.CoroutineMock(return_value
=("", 0))
618 await self
.helm_conn
._uninstall
_sw
(self
.cluster_id
, self
.namespace
)
619 calls
= self
.helm_conn
._local
_async
_exec
.call_args_list
621 len(calls
), 3, "To uninstall should have executed three commands"
623 call0_kargs
= calls
[0][1]
624 command_0
= "/usr/bin/helm --kubeconfig={} --home={} reset".format(
625 self
.kube_config
, self
.helm_home
629 {"command": command_0
, "raise_exception_on_error": True, "env": self
.env
},
630 "Invalid args for first call to local_exec",
632 call1_kargs
= calls
[1][1]
634 "/usr/bin/kubectl --kubeconfig={} delete "
635 "clusterrolebinding.rbac.authorization.k8s.io/osm-tiller-cluster-rule".format(
641 {"command": command_1
, "raise_exception_on_error": False, "env": self
.env
},
642 "Invalid args for second call to local_exec",
644 call2_kargs
= calls
[2][1]
646 "/usr/bin/kubectl --kubeconfig={} --namespace {} delete "
647 "serviceaccount/{}".format(
648 self
.kube_config
, self
.namespace
, self
.service_account
653 {"command": command_2
, "raise_exception_on_error": False, "env": self
.env
},
654 "Invalid args for third call to local_exec",