-
Notifications
You must be signed in to change notification settings - Fork 4k
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): correct logic of healthcheck command #2462
Conversation
Adding a healthcheck command to an ECS container definition results in an invalid command after synthesizing. Before: Input: ['CMD', 'command'] Output: HealthCheck: Command: - CMD - CMD - echo - z Input: ['CMD-SHELL', 'command'] Output: HealthCheck: Command: - CMD - CMD-SHELL - echo - z After: Input: ['CMD', 'command'] Output: HealthCheck: Command: - CMD - echo - z Input: ['CMD-SHELL', 'command'] Output: HealthCheck: Command: - CMD-SHELL - echo - z fixes #2461 Signed-off-by: Chris Lahaye <dev@chrislahaye.com>
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.
LGTM, thanks for fixing!
@@ -478,7 +478,7 @@ function getHealthCheckCommand(hc: HealthCheck): string[] { | |||
return hcCommand; | |||
} | |||
|
|||
if (cmd[0] !== "CMD" || cmd[0] !== 'CMD-SHELL') { | |||
if (cmd[0] !== "CMD" && cmd[0] !== 'CMD-SHELL') { |
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.
Can you add a unit test to ensure that this check is working as expected?
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.
@pkandasamy91 the existing test should be sufficient.
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.
Will add missing tests in a separate PR.
Adding a healthcheck command to an ECS container definition results in an invalid command after synthesizing. Before: Input: ['CMD', 'command'] Output: HealthCheck: Command: - CMD - CMD - echo - z Input: ['CMD-SHELL', 'command'] Output: HealthCheck: Command: - CMD - CMD-SHELL - echo - z After: Input: ['CMD', 'command'] Output: HealthCheck: Command: - CMD - echo - z Input: ['CMD-SHELL', 'command'] Output: HealthCheck: Command: - CMD-SHELL - echo - z fixes aws#2461 Signed-off-by: Chris Lahaye <dev@chrislahaye.com>
Adding a healthcheck command to an ECS container definition
results in an invalid command after synthesizing.
Before:
After:
fixes #2461
Signed-off-by: Chris Lahaye dev@chrislahaye.com
Pull Request Checklist
design
folderBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.