-
Notifications
You must be signed in to change notification settings - Fork 619
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
api: add Hostname, ExtraHosts for pause container #1278
Conversation
90d2e00
to
88f892a
Compare
4a152ed
to
51a456a
Compare
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.
Code LGTM, can you add a functional test for this.
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.
apart from the functional test modification, you're also missing a bump to the state file version.
agent/api/eni.go
Outdated
@@ -38,6 +38,9 @@ type ENI struct { | |||
// DomainNameSearchList specifies the search list for the domain | |||
// name lookup, for the eni | |||
DomainNameSearchList []string `json:",omitempty"` | |||
|
|||
// PrivateDnsName is the dns name assigned by the vpc to this eni | |||
PrivateDnsName string `json:",omitempty"` |
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.
nit: PrivateDNSName
agent/api/eni.go
Outdated
"eni id:%s, mac: %s, ipv4addresses: [%s], ipv6addresses: [%s], dns: [%s], dns search: [%s]", | ||
eni.ID, eni.MacAddress, strings.Join(ipv4Addresses, ","), strings.Join(ipv6Addresses, ","), | ||
"eni id:%s, mac: %s, hostname: %s, ipv4addresses: [%s], ipv6addresses: [%s], dns: [%s], dns search: [%s]", | ||
eni.ID, eni.MacAddress, eni.PrivateDnsName, strings.Join(ipv4Addresses, ","), strings.Join(ipv6Addresses, ","), |
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.
shouldn't you use GetHostName()
here?
@aaithal @richardpen, sgtm, will add(update?) functional test for this. tracking here #1307 |
86afcd0
to
9f2032c
Compare
agent/api/eni.go
Outdated
@@ -38,6 +38,9 @@ type ENI struct { | |||
// DomainNameSearchList specifies the search list for the domain | |||
// name lookup, for the eni | |||
DomainNameSearchList []string `json:",omitempty"` | |||
|
|||
// PrivateDnsName is the dns name assigned by the vpc to this eni |
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.
nit: PrivateDNSName
9f2032c
to
88bde97
Compare
This change adds Hostname and ExtraHosts to the pause container's docker config and host config respectively. This allows awsvpc tasks to have /etc/hosts entries for the ENI private ips
88bde97
to
00cfae1
Compare
Summary
This change adds
Hostname
andExtraHosts
to the pause container's dockerconfig and host config respectively. This allows awsvpc tasks to have
/etc/hosts
entries for the ENI private IPsImplementation details
Testing
make release
)go build -out amazon-ecs-agent.exe ./agent
)make test
) passgo test -timeout=25s ./agent/...
) passmake run-integ-tests
) pass.\scripts\run-integ-tests.ps1
) passmake run-functional-tests
) pass.\scripts\run-functional-tests.ps1
) passNew tests cover the changes:
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.