def kill_microservice(name: str, ns: str = "default", label_selector: str = "name in ({name})", secrets: Secrets = None): """ !!!DEPRECATED!!! """ _log_deprecated("kill_microservice", "delete_deployment/delete_replica_set/delete_pods") delete_deployment(name, ns, label_selector, secrets) delete_replica_set(name, ns, label_selector, secrets) delete_pods(name, ns, label_selector, secrets)
def test_delete_deployment(client, api): depl1 = V1Deployment(metadata=V1ObjectMeta(name="depl1")) depl2 = V1Deployment(metadata=V1ObjectMeta(name="depl2")) v1 = MagicMock() client.AppsV1beta1Api.return_value = v1 v1.list_namespaced_deployment.return_value = V1DeploymentList( items=(depl1, depl2)) delete_deployment("fake_name", "fake_ns") v1.list_namespaced_deployment.assert_called_with("fake_ns", label_selector=ANY) v1.delete_namespaced_deployment.assert_has_calls(calls=[ call(depl1.metadata.name, "fake_ns", body=ANY), call(depl2.metadata.name, "fake_ns", body=ANY) ], any_order=True)