Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[DHPA] Upudate dockerPortMap() in task.go with dynamic host port range support - part 1 #3584
[DHPA] Upudate dockerPortMap() in task.go with dynamic host port range support - part 1 #3584
Changes from all commits
339e375
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
An example ecs-agent.log for line 2415 - 2427
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.
QQ. Is this method used anywhere other than in task_test.go ? If not, could you move it to the test file?
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.
Also do we verify that a port is within range in our taskdef validation or elsewhere? Where is this same validation done outside of our tests?
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.
This method is used in both
agent/utils/ephemeral_ports_test.go
andagent/api/task/task_test.go
in this PR. As it's using in different packages, I have to make it as a public method.And as fierlion@ suggested, we should validate a host port or a host port range assigned by ECS Agent after calling
getHostPort()
orgetHostPortRange()
. Therefore, I would like to keepVerifyPortsWithinRange()
inagent/utils/ephemeral_ports.go
, and have a follow up PR to implement host port validations outside of our tests.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.
Changes are made in https://github.com/aws/amazon-ecs-agent/pull/3589/files#diff-d475c5ecd1be9e633e4fde242318c1369112ce30a3a122288779c5cc277a7b93.