mirror of
https://github.com/ansible/awx.git
synced 2026-03-28 06:15:04 -02:30
Merge pull request #5327 from ryanpetrello/more-container-group-fixes
fix a few bugs related to container group execution Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -173,7 +173,7 @@ def generate_tmp_kube_config(credential, namespace):
|
|||||||
"current-context": host_input
|
"current-context": host_input
|
||||||
}
|
}
|
||||||
|
|
||||||
if credential.get_input('verify_ssl'):
|
if credential.get_input('verify_ssl') and 'ssl_ca_cert' in credential.inputs:
|
||||||
config["clusters"][0]["cluster"]["certificate-authority-data"] = b64encode(
|
config["clusters"][0]["cluster"]["certificate-authority-data"] = b64encode(
|
||||||
credential.get_input('ssl_ca_cert').encode() # encode to bytes
|
credential.get_input('ssl_ca_cert').encode() # encode to bytes
|
||||||
).decode() # decode the base64 data into a str
|
).decode() # decode the base64 data into a str
|
||||||
|
|||||||
@@ -258,19 +258,24 @@ class TaskManager():
|
|||||||
for group in InstanceGroup.objects.all():
|
for group in InstanceGroup.objects.all():
|
||||||
if group.is_containerized or group.controller_id:
|
if group.is_containerized or group.controller_id:
|
||||||
continue
|
continue
|
||||||
match = group.find_largest_idle_instance()
|
match = group.fit_task_to_most_remaining_capacity_instance(task)
|
||||||
if match:
|
if match:
|
||||||
break
|
break
|
||||||
task.instance_group = rampart_group
|
task.instance_group = rampart_group
|
||||||
if task.supports_isolation():
|
if match is None:
|
||||||
task.controller_node = match.hostname
|
logger.warn(
|
||||||
|
'No available capacity to run containerized <{}>.'.format(task.log_format)
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
# project updates and inventory updates don't *actually* run in pods,
|
if task.supports_isolation():
|
||||||
# so just pick *any* non-isolated, non-containerized host and use it
|
task.controller_node = match.hostname
|
||||||
# as the execution node
|
else:
|
||||||
task.execution_node = match.hostname
|
# project updates and inventory updates don't *actually* run in pods,
|
||||||
logger.debug('Submitting containerized {} to queue {}.'.format(
|
# so just pick *any* non-isolated, non-containerized host and use it
|
||||||
task.log_format, task.execution_node))
|
# as the execution node
|
||||||
|
task.execution_node = match.hostname
|
||||||
|
logger.debug('Submitting containerized {} to queue {}.'.format(
|
||||||
|
task.log_format, task.execution_node))
|
||||||
else:
|
else:
|
||||||
task.instance_group = rampart_group
|
task.instance_group = rampart_group
|
||||||
if instance is not None:
|
if instance is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user