Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[semver:minor] Always allow platform-version overrides #122

Merged
merged 1 commit into from
Mar 18, 2021

Conversation

lokst
Copy link
Contributor

@lokst lokst commented Mar 1, 2021

Resolves #121

Change the default value for the platform-version command/job parameter from LATEST to '', and only provide the --platform-version argument to the AWS CLI when platform-version is non-blank.

The AWS CLI docs for --platform-version (https://docs.aws.amazon.com/cli/latest/reference/ecs/run-task.html) state:

If one is not specified, the LATEST platform version is used by default

Hence, this PR should generally be a backwards-compatible change since the AWS CLI already uses LATEST as the default when no --platform-version argument is provided to the CLI anyway, so not passing --platform-version (which will be the new orb default behavior) should have the same effect as explicitly setting --platform-version LATEST when the launch type is FARGATE, as the orb would do in the past.

…-platform-version argument when the parameter is not any empty string
@lokst lokst marked this pull request as ready for review March 1, 2021 06:42
@lokst lokst requested a review from a team March 1, 2021 06:43
@dsayling
Copy link

dsayling commented Mar 1, 2021

If launch type isn't fargate and they set the string, will something unexpected happen?

@lokst
Copy link
Contributor Author

lokst commented Mar 3, 2021

If launch type isn't fargate and they set the string, will something unexpected happen?

I think the CLI would show an error message, but I'll test it out to confirm

@lokst
Copy link
Contributor Author

lokst commented Mar 18, 2021

@dsayling Tested this out with an EC2 launch-type. The CLI does perform some validation on the --platform-version argument 🎉

aws ecs register-task-definition \
              --family ecs-orb-ec2-1-sleep360 \
              --cpu 256 --memory 512 \
              --container-definitions "[{\"name\":\"sleep\",\"image\":\"busybox\",\"command\":[\"sleep\",\"360\"],\"memory\":256,\"essential\":true}]" --region us-east-1

aws ecs run-task --platform-version "LATEST" --cluster ecs-orb-ec2-1-cluster --launch-type EC2 --task-definition ecs-orb-ec2-1-sleep360:114 --region us-east-1
An error occurred (InvalidParameterException) when calling the RunTask operation: The platform version must be null when specifying an EC2 launch type.

@lokst lokst merged commit 0db2a84 into master Mar 18, 2021
@lokst lokst deleted the set-platform-version branch March 18, 2021 08:04
@lokst
Copy link
Contributor Author

lokst commented Mar 18, 2021

The changes are now available in circleci/aws-ecs@2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

platform-version is not used in the run-task command when using Fargate Spot
2 participants