Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a service had ECS Service Connect enabled, it listed an extra item in the Attachments struct. The code was specifically only expecting one item. Now it can handle more than one Attachment and correctly pick the network interface values. At the moment AWS only allows one network interface, so the new method should work and in the future will just return the last one listed in Attachments:
https://docs.aws.amazon.com/AmazonECS/latest/userguide/fargate-task-networking.html
I refactored the code that determines the networking details into its own function and added 3 unit tests for the various situations.
I know that there is not an easy way to spin up a fargate cluster with Service Connect just for testing, but anyone helping with testing should at least make sure that any existing functionality still works. This code is used by
service info
andservice ps
in particular.