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

Fixing Agent reports incorrect capabilities on windows (#2035) #2070

Merged
merged 1 commit into from
Jun 7, 2019

Conversation

mssrivas
Copy link
Contributor

@mssrivas mssrivas commented Jun 5, 2019

Summary
Fixing Agent reports incorrect capabilities on windows.
Issue - #2035

Implementation details
Implemented capabilities through methods that explicitly set it for a unix system and not for a windows

Testing
New tests cover the changes: Adding new unit tests
Verified by running following commands -
On Unix : docker run -v /var/run/docker.sock:/var/run/docker.sock amazon/amazon-ecs-agent --ecs-attributes
On Windows : aws --region us-east-1 ecs describe-container-instances --cluster window --container-instances 05ef0d5f98774e839c9e47b4158c5c57

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.

@mssrivas mssrivas marked this pull request as ready for review June 5, 2019 20:08
@yumex93
Copy link
Contributor

yumex93 commented Jun 5, 2019

I think you need to update the windows test file agent_capability_windows_test.go to add the test case to check that we do not introduce redundant capabilities for windows. Currently, we do not have any test case there.

for i, expected := range expectedCapabilities {
assert.Equal(t, aws.StringValue(expected.Name), aws.StringValue(capabilities[i].Name))
assert.Equal(t, aws.StringValue(expected.Value), aws.StringValue(capabilities[i].Value))
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment here to give a description about what this test case is doing?

assert.NoError(t, err)
assert.Equal(t, len(expectedCapabilities), len(capabilities))
for i, expected := range expectedCapabilities {

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this blank line can be removed.

@mssrivas mssrivas force-pushed the Issues branch 2 times, most recently from 17665e0 to 6b77b00 Compare June 5, 2019 23:01
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