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

Update service connect config validator #3424

Merged
merged 1 commit into from
Oct 10, 2022

Conversation

chienhanlin
Copy link
Contributor

Summary

As service connect config will be validated in ECS control plane before streaming down to Agent, Agent will only validate service connect configurations when

  1. fields consumed and proceeded by ECS Agent
  2. fields with a global standard, e.g. CIDR format

Implementation details

  1. service_connect_validator.go
  • Main change: remove both nil egress config and empty ingress config validation
  • Main change: remove non-empty IPV4CIDR validation and non-empty IPV6CIDR validation
  • Main change: remove DNS config must exist when egress config us not nil validation
  • Refactor error messages into constants
  • Update variable naming and format
  1. service_connect_validator_test.go
  • Remove following tests as corresponding validations are removed from service_connect_validator.go
    • "AWSVPC default case with the empty ingress config and engress config" test
    • "AWSVPC default case with no IPv4 CIDR in the egress config when Ipv6 is not enabled" test
    • "AWSVPC default case with no IPv6 CIDR in the egress config when IPv6 is enabled" test
    • "Bridge default case with the egress config but no dns config" test
  1. agent/api/task/task_attachment_handler_test.go
  • Update "AWSVPC IPv6 enabled with error" test as an empty IPv4CIDR validation is removed from service_connect_validator.go

Testing

New tests cover the changes: no

Description for the changelog

Update service connect config validator to validate fields with a global standard, or consumed and proceeded by ECS Agent

Licensing

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

to validate:
1. fields consumed and proceeded by ECS Agent
2. fields with a global standard
@chienhanlin chienhanlin merged commit b344f11 into aws:dev Oct 10, 2022
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