-
Notifications
You must be signed in to change notification settings - Fork 617
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
expose availabilityZone to ECS metadata file #1675
Conversation
I didn't see where you actually add az to metadata manager, I think this PR can be completed after your another PR is merged. You can add a |
} | ||
|
||
// setAvailabilityZone indicates an expected call of setAvailabilityZone | ||
func (mr *MockDockerMetadataClientMockRecorder) setAvailabilityZone(arg0 interface{}) *gomock.Call { |
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.
is this added by mistake?
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.
these two functions are auto generated when I ran go generate.
agent/app/agent_test.go
Outdated
@@ -65,7 +66,8 @@ func setup(t *testing.T) (*gomock.Controller, | |||
*mock_api.MockECSClient, | |||
*mock_dockerapi.MockDockerClient, | |||
*mock_factory.MockStateManager, | |||
*mock_factory.MockSaveableOption) { | |||
*mock_factory.MockSaveableOption, | |||
*mock_containermetadata.MockManager) { |
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.
why do you need to mock container metadata manager?
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.
remove it and add a separate test to test set availabilityZone.
Summary
we also want to expose availabilityZone to the ECS metadata file.
Implementation details
set availabilityZone to the containermetadata manager and pass it to the ECS metadata file after agent start.
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.