From e871c2e8afe2d7df94b72643611e901ced8ff846 Mon Sep 17 00:00:00 2001 From: micafer Date: Fri, 27 Nov 2020 11:03:06 +0100 Subject: [PATCH] Fix/Iprove Kube conn --- IM/connectors/Kubernetes.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/IM/connectors/Kubernetes.py b/IM/connectors/Kubernetes.py index 8088d8f82..78717ab51 100644 --- a/IM/connectors/Kubernetes.py +++ b/IM/connectors/Kubernetes.py @@ -368,6 +368,13 @@ def launch(self, inf, radl, requested_radl, num_vm, auth_data): res.append((False, "Error creating the Namespace: " + resp.text)) return res + # we need to assure it has been created before creating other resources + resp = self.create_request('GET', uri + namespace, auth_data, headers) + if resp.status_code != 200: + for _ in range(num_vm): + res.append((False, "Error creating the Namespace")) + return res + i = 0 while i < num_vm: try: @@ -390,6 +397,7 @@ def launch(self, inf, radl, requested_radl, num_vm, auth_data): resp = self.create_request('POST', uri, auth_data, headers, pod_data) if resp.status_code != 201: + self.log_error("Error creating the Container: " + resp.text) res.append((False, "Error creating the Container: " + resp.text)) try: self._delete_volume_claims(pod_data, auth_data)