Merge pull request #3953 from ryanpetrello/more-container-group-fixes

[3.6.1] fix a few bugs related to container group execution
This commit is contained in:
Ryan Petrello
2019-11-18 14:27:18 -05:00
committed by GitHub
2 changed files with 15 additions and 10 deletions

View File

@@ -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

View File

@@ -258,10 +258,15 @@ 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 match is None:
logger.warn(
'No available capacity to run containerized <{}>.'.format(task.log_format)
)
else:
if task.supports_isolation(): if task.supports_isolation():
task.controller_node = match.hostname task.controller_node = match.hostname
else: else: