From f1345a5fcf1896f70ba56649b514026921c412e6 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sat, 18 Nov 2023 16:20:03 -0700 Subject: [PATCH] Bypass kind cluster create for remote k8s case --- stack_orchestrator/deploy/k8s/deploy_k8s.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/stack_orchestrator/deploy/k8s/deploy_k8s.py b/stack_orchestrator/deploy/k8s/deploy_k8s.py index 3fde09ab..59ccdf23 100644 --- a/stack_orchestrator/deploy/k8s/deploy_k8s.py +++ b/stack_orchestrator/deploy/k8s/deploy_k8s.py @@ -52,8 +52,9 @@ class K8sDeployer(Deployer): self.apps_api = client.AppsV1Api() def up(self, detach, services): - # Create the kind cluster - create_cluster(self.kind_cluster_name, self.deployment_dir.joinpath("kind-config.yml")) + if self.is_kind(): + # Create the kind cluster + create_cluster(self.kind_cluster_name, self.deployment_dir.joinpath("kind-config.yml")) self.connect_api() # Ensure the referenced containers are copied into kind load_images_into_kind(self.kind_cluster_name, self.cluster_info.image_set) @@ -92,8 +93,9 @@ class K8sDeployer(Deployer): def down(self, timeout, volumes): # Delete the k8s objects - # Destroy the kind cluster - destroy_cluster(self.kind_cluster_name) + if self.is_kind(): + # Destroy the kind cluster + destroy_cluster(self.kind_cluster_name) def ps(self): self.connect_api()