-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix(ecs): services essential container exceptions thrown too soon #13240
Conversation
P.S., I'm not sure if this is a feature, fix, or chore, so I picked fix because I don't know what I'd write in the README to pass the PR linter for a feat, but it fixes a Dx issue from my perspective. |
if (!props.taskDefinition.defaultContainer) { | ||
throw new Error('A TaskDefinition must have at least one essential container'); | ||
protected onValidate() { | ||
const validationErrors = super.onValidate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the change, but we're changing the way we do validations in v2, and we need new code to be compatible with the new way of doing things.
New way looks like:
this.node.addValidation({
validate: () => !this.taskDefinition.defaultContainer ? ['A taskdefinition...'] : [],
});
Pull request has been modified.
I looked at the v2-main branch and undid the bit where I tried to bring the addXxxCapacity validation into the same addValidation as this essential container validation so that there's not a v2 merge conflict problem. |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
This PR defers the
A TaskDefinition must have at least one essential container
error to the validate phase.
Closes #13239
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license