AWS nodeup.py shall use "additional_spec" even if the AMI is overriden by the docker image
@@ -1241,17 +1241,18 @@ def main():
api.session.verify = False
instance_additional_spec = None
- if not ins_img or ins_img == 'null':
- # Redefine default instance image if cloud metadata has specific rules for instance type
allowed_instance = get_allowed_instance_image(aws_region, ins_type, ins_platform, ins_img)
if allowed_instance and allowed_instance["instance_mask"]:
- pipe_log('Found matching rule {instance_mask}/{ami} for requested instance type {instance_type}\nImage {ami} will be used'.format(instance_mask=allowed_instance["instance_mask"],
- ami=allowed_instance["instance_mask_ami"],
- instance_type=ins_type))
- ins_img = allowed_instance["instance_mask_ami"]
+ pipe_log('Found matching rule {instance_mask} for requested instance type {instance_type}'.format(instance_mask=allowed_instance["instance_mask"], instance_type=ins_type))
instance_additional_spec = allowed_instance["additional_spec"]
if instance_additional_spec:
pipe_log('Additional custom instance configuration will be added: {}'.format(instance_additional_spec))
+ if not ins_img or ins_img == 'null':
+ if allowed_instance and allowed_instance["instance_mask_ami"]:
+ ins_img = allowed_instance["instance_mask_ami"]
+ pipe_log('Instance image was not provided explicitly, {instance_image} will be used (retrieved for {instance_mask}/{instance_type} rule)'.format(instance_image=allowed_instance["instance_mask_ami"],
+ instance_mask=allowed_instance["instance_mask"],
+ instance_type=ins_type))
else:
pipe_log('Specified in configuration image {ami} will be used'.format(ami=ins_img))
