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

change ports response from Ports to KnownPortBindings #2495

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

sharanyad
Copy link
Contributor

@sharanyad sharanyad commented Jun 25, 2020

Summary

addresses #2476

Implementation details

when host port is set to 0 in task def for bridge mode, the same is used as part of http metadata response to the container.
Changing this to use the updated port bindings retrieved from docker.
Metadata file uses the port bindings from docker as well.

Testing

manual testing:
after the change

# curl $ECS_CONTAINER_METADATA_URI_V4/task | grep HostPort
                    "HostPort": 32774,

before the change

# curl $ECS_CONTAINER_METADATA_URI_V4/task | grep HostPort
#

New tests cover the changes: yes

Description for the changelog

Licensing

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

@sharanyad sharanyad requested a review from a team June 26, 2020 04:29
Copy link
Member

@fierlion fierlion left a comment

Choose a reason for hiding this comment

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

KnownPortBindingsUnsafe are you calling it Unsafe to guard against setting it directly as mentioned in the comments in container.go?

	// NOTE: Do not access <unsafeVar> directly. Instead, use `Get<Var>`
	// and `Set<Var>`.

@sharanyad sharanyad merged commit 0d002a1 into aws:dev Jun 29, 2020
@sharanyad sharanyad added this to the 1.41.1 milestone Jul 1, 2020
@fenxiong fenxiong mentioned this pull request Jul 6, 2020
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.

5 participants