Skip to content

Commit

Permalink
Merge pull request #1091 from grycap/devel
Browse files Browse the repository at this point in the history
Fix/Iprove Kube conn
  • Loading branch information
micafer authored Nov 27, 2020
2 parents cec7ee7 + e871c2e commit 092cb1c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions IM/connectors/Kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit 092cb1c

Please sign in to comment.