k8s provision update
fix */list
This commit is contained in:
@@ -1367,7 +1367,7 @@ class DecortController(object):
|
||||
api_resp = self.decort_api_call(requests.post, "/restmachine/cloudapi/image/list", api_params)
|
||||
# On success the above call will return here. On error it will abort execution by calling fail_json.
|
||||
images_list = json.loads(api_resp.content.decode('utf8'))
|
||||
for image_record in images_list:
|
||||
for image_record in images_list['data']:
|
||||
if image_record['name'] == image_name and image_record['status'] == "CREATED":
|
||||
if sepid == 0 and pool == "":
|
||||
# if no filtering by SEP ID or pool name is requested, return the first match
|
||||
@@ -3414,10 +3414,18 @@ class DecortController(object):
|
||||
return
|
||||
|
||||
def k8s_provision(self, k8s_name,
|
||||
k8ci_id,rg_id,plugin,master_count,
|
||||
master_cpu, master_ram,
|
||||
master_disk, default_worker, extnet_id,
|
||||
with_lb, annotation, ):
|
||||
k8ci_id,rg_id,
|
||||
plugin,
|
||||
master_count,
|
||||
master_cpu,
|
||||
master_ram,
|
||||
master_disk,
|
||||
master_sepid,
|
||||
master_pool,
|
||||
default_worker,
|
||||
extnet_id,
|
||||
with_lb,
|
||||
annotation, ):
|
||||
|
||||
self.result['waypoints'] = "{} -> {}".format(self.result['waypoints'], "k8s_provision")
|
||||
|
||||
@@ -3431,6 +3439,8 @@ class DecortController(object):
|
||||
def_wg_cpu = default_worker['cpu']
|
||||
def_wg_ram = default_worker['ram']
|
||||
def_wg_disk = default_worker['disk']
|
||||
def_wg_sepid = default_worker['sep_id']
|
||||
def_wg_pool = default_worker['pool']
|
||||
def_wg_lab = default_worker['labels'] if "labels" in default_worker else None
|
||||
def_wg_taints = default_worker['taints'] if "taints" in default_worker else None
|
||||
def_wg_ann = default_worker['annotations'] if "annotations" in default_worker else None
|
||||
@@ -3445,10 +3455,14 @@ class DecortController(object):
|
||||
masterCpu=master_cpu,
|
||||
masterRam=master_ram,
|
||||
masterDisk=master_disk,
|
||||
masterSepId=master_sepid,
|
||||
masterSepPool=master_pool,
|
||||
workerNum=def_wg_count,
|
||||
workerCpu=def_wg_cpu,
|
||||
workerRam=def_wg_ram,
|
||||
workerDisk=def_wg_disk,
|
||||
workerSepId=def_wg_sepid,
|
||||
workerSepPool=def_wg_pool,
|
||||
labels=def_wg_lab,
|
||||
taints=def_wg_taints,
|
||||
annotations=def_wg_ann,
|
||||
@@ -3472,8 +3486,8 @@ class DecortController(object):
|
||||
self.result['failed'] = False
|
||||
time.sleep(30)
|
||||
elif ret_info['status'] == "ERROR":
|
||||
self.result['msg'] = ("k8s_provision(): Can't create cluster")
|
||||
self.result['failed'] = True
|
||||
self.result['msg'] = f"k8s_provision(): {ret_info['error']}"
|
||||
self.result['changed'] = False
|
||||
return
|
||||
elif ret_info['status'] == "OK":
|
||||
k8s_id = ret_info['result']
|
||||
@@ -3493,7 +3507,6 @@ class DecortController(object):
|
||||
self.result['failed'] = True
|
||||
|
||||
self.result['changed'] = False
|
||||
self.fail_json(**self.result)
|
||||
return
|
||||
|
||||
def k8s_workers_modify(self,arg_k8swg,arg_modwg):
|
||||
@@ -3546,6 +3559,8 @@ class DecortController(object):
|
||||
workerCpu=wg['cpu'],
|
||||
workerRam=wg['ram'],
|
||||
workerDisk=wg['disk'],
|
||||
workerSepId=wg['sep_id'] if "sep_id" in wg else None,
|
||||
workerSepPool=wg['pool'] if "pool" in wg else None,
|
||||
labels=wg['labels'] if "labels" in wg else None,
|
||||
taints=wg['taints'] if "taints" in wg else None,
|
||||
annotations=wg['annotations'] if "annotations" in wg else None,
|
||||
|
||||
Reference in New Issue
Block a user