Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Conversation

@PettitWesley
Copy link
Contributor

Fixes a minor bug: previously errors weren't caught on from the AddFile method for user data. This meant that something like this will erroneously succeed:

ecs-cli up --capability-iam --extra-user-data some_file_that_doesnt_exit

This PR fixes the issue by checking the error.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@SoManyHs SoManyHs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add manual test output from before and after?

@PettitWesley
Copy link
Contributor Author

@SoManyHs

Before (command erroneously succeeds):

$ ecs-cli up --cluster oops --region sa-east-1 --capability-iam --extra-user-data some_file_that_does_not_exist
WARN[0000] You will not be able to SSH into your EC2 instances without a key pair. 
INFO[0002] Using recommended Amazon Linux AMI with ECS Agent 1.21.0 and Docker version 18.06.1-ce 
INFO[0003] Created cluster                               cluster=oops region=sa-east-1
INFO[0005] Waiting for your cluster resources to be created... 
INFO[0005] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
INFO[0068] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS
INFO[0130] Cloudformation stack status                   stackStatus=CREATE_IN_PROGRESS

After:

$ ecs-cli up --cluster oops --region sa-east-1 --capability-iam --extra-user-data some_file_that_does_not_exist
WARN[0000] You will not be able to SSH into your EC2 instances without a key pair. 
FATA[0000] Error executing 'up': open some_file_that_does_not_exist: no such file or directory 

@PettitWesley PettitWesley merged commit ad68bda into aws:dev Oct 24, 2018
@PettitWesley PettitWesley deleted the catch-user-data-error branch October 24, 2018 21:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants