diff --git a/acto/kubernetes_engine/kind.py b/acto/kubernetes_engine/kind.py index 826ca10793..09dac36752 100644 --- a/acto/kubernetes_engine/kind.py +++ b/acto/kubernetes_engine/kind.py @@ -110,7 +110,7 @@ def create_cluster(self, name: str, kubeconfig: str): cmd.extend(["--image", f"kindest/node:{self._k8s_version}"]) - p = subprocess.run(cmd, check=True) + p = subprocess.run(cmd, check=False) i = 0 while p.returncode != 0: if i == 3: @@ -122,7 +122,7 @@ def create_cluster(self, name: str, kubeconfig: str): i += 1 self.delete_cluster(name, kubeconfig) time.sleep(5) - p = subprocess.run(cmd, check=True) + p = subprocess.run(cmd, check=False) try: kubernetes.config.load_kube_config( @@ -154,7 +154,7 @@ def load_images(self, images_archive_path: str, name: str): else: logging.error("Missing cluster name for kind load") - p = subprocess.run(cmd + [images_archive_path], check=True) + p = subprocess.run(cmd + [images_archive_path], check=False) if p.returncode != 0: logging.error("Failed to preload images archive") @@ -171,7 +171,7 @@ def delete_cluster(self, name: str, kubeconfig: str): else: raise RuntimeError("Missing kubeconfig for kind create") - while subprocess.run(cmd, check=True).returncode != 0: + while subprocess.run(cmd, check=False).returncode != 0: continue def get_node_list(self, name: str): diff --git a/acto/kubernetes_engine/minikube.py b/acto/kubernetes_engine/minikube.py index 6041012e7f..400bd7c965 100644 --- a/acto/kubernetes_engine/minikube.py +++ b/acto/kubernetes_engine/minikube.py @@ -69,7 +69,7 @@ def create_cluster(self, name: str, kubeconfig: str): cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, - check=True, + check=False, ) i = 0 @@ -83,7 +83,7 @@ def create_cluster(self, name: str, kubeconfig: str): i += 1 self.delete_cluster(name, kubeconfig) time.sleep(5) - p = subprocess.run(cmd, check=True) + p = subprocess.run(cmd, check=False) # csi driver cmd = ["minikube", "addons", "disable", "storage-provisioner"] @@ -93,7 +93,7 @@ def create_cluster(self, name: str, kubeconfig: str): cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, - check=True, + check=False, ) i = 0 print(cmd) @@ -107,7 +107,7 @@ def create_cluster(self, name: str, kubeconfig: str): i += 1 self.delete_cluster(name, kubeconfig) time.sleep(5) - p = subprocess.run(cmd, check=True) + p = subprocess.run(cmd, check=False) cmd = ["minikube", "addons", "disable", "default-storageclass"] cmd.extend(["--profile", name]) @@ -116,7 +116,7 @@ def create_cluster(self, name: str, kubeconfig: str): cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, - check=True, + check=False, ) i = 0 print(cmd) @@ -130,7 +130,7 @@ def create_cluster(self, name: str, kubeconfig: str): i += 1 self.delete_cluster(name, kubeconfig) time.sleep(5) - p = subprocess.run(cmd, check=True) + p = subprocess.run(cmd, check=False) cmd = ["minikube", "addons", "enable", "volumesnapshots"] cmd.extend(["--profile", name]) @@ -138,7 +138,7 @@ def create_cluster(self, name: str, kubeconfig: str): cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, - check=True, + check=False, ) i = 0 print(cmd) @@ -152,7 +152,7 @@ def create_cluster(self, name: str, kubeconfig: str): i += 1 self.delete_cluster(name, kubeconfig) time.sleep(5) - p = subprocess.run(cmd, check=True) + p = subprocess.run(cmd, check=False) cmd = ["minikube", "addons", "enable", "csi-hostpath-driver"] cmd.extend(["--profile", name]) @@ -160,7 +160,7 @@ def create_cluster(self, name: str, kubeconfig: str): cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, - check=True, + check=False, ) i = 0 print(cmd) @@ -174,7 +174,7 @@ def create_cluster(self, name: str, kubeconfig: str): i += 1 self.delete_cluster(name, kubeconfig) time.sleep(5) - p = subprocess.run(cmd, check=True) + p = subprocess.run(cmd, check=False) cmd = [ "kubectl", @@ -188,7 +188,7 @@ def create_cluster(self, name: str, kubeconfig: str): cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, - check=True, + check=False, ) i = 0 print(cmd) @@ -202,7 +202,7 @@ def create_cluster(self, name: str, kubeconfig: str): i += 1 self.delete_cluster(name, kubeconfig) time.sleep(5) - p = subprocess.run(cmd, check=True) + p = subprocess.run(cmd, check=False) # minikube mount cmd = ["minikube", "mount", "profile/data:/tmp/profile"] @@ -239,7 +239,7 @@ def load_images(self, images_archive_path: str, name: str): else: logging.error("Missing cluster name for minikube load") - p = subprocess.run(cmd + [images_archive_path], check=True) + p = subprocess.run(cmd + [images_archive_path], check=False) if p.returncode != 0: logging.error("Failed to preload images archive") @@ -257,7 +257,7 @@ def delete_cluster(self, name: str, kubeconfig: str): else: raise RuntimeError("Missing kubeconfig for minikube create") - while subprocess.run(cmd, check=True).returncode != 0: + while subprocess.run(cmd, check=False).returncode != 0: continue os.environ.pop("KUBECONFIG", None)