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

Filter out propagated 'aws:' tags and remove skipped tagging test #1706

Merged
merged 1 commit into from
Nov 27, 2018

Conversation

haikuoliu
Copy link
Contributor

Summary

This PR is mainly to resolve issue #1704.

  1. Filter propagated tags start with "aws:"
  2. Remove the skipped tagging functional tests

Testing

  • Builds on Linux (make release)
  • Builds on Windows (go build -out amazon-ecs-agent.exe ./agent)
  • Unit tests on Linux (make test) pass
  • Unit tests on Windows (go test -timeout=25s ./agent/...) pass
  • Integration tests on Linux (make run-integ-tests) pass
  • Integration tests on Windows (.\scripts\run-integ-tests.ps1) pass
  • Functional tests on Linux (make run-functional-tests) pass
  • Functional tests on Windows (.\scripts\run-functional-tests.ps1) pass

Licensing

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

@haikuoliu haikuoliu requested a review from a team November 27, 2018 19:38
Copy link
Contributor

@sharanyad sharanyad left a comment

Choose a reason for hiding this comment

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

lgtm

})
// Filter out all tags "aws:" prefix
if !strings.HasPrefix(strings.ToLower(aws.StringValue(ec2Tag.Key)), awsTagPrefix) &&
!strings.HasPrefix(strings.ToLower(aws.StringValue(ec2Tag.Value)), awsTagPrefix) {
Copy link
Contributor

Choose a reason for hiding this comment

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

even values with aws prefix are rejected?

Copy link
Contributor

@petderek petderek Nov 27, 2018

Choose a reason for hiding this comment

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

The service will still reject something with key "aws:foo" and value "bar", right? We should change this if so.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, value with aws prefix will be rejected as well, see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions

Tags with key "aws:foo" and value "bar" will be filtered out here, I added test cases.

@haikuoliu
Copy link
Contributor Author

The failing test is TestAgentIntrospectionValidator which is a know flaky test, going to merge this PR

@haikuoliu haikuoliu merged commit e1cdce2 into aws:dev Nov 27, 2018
@yumex93 yumex93 added this to the 1.23.0 milestone Dec 4, 2018
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