Refactor ACS attach task ENI message handling #3744
Merged
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.
Summary
Refactor ACS attach task ENI message handling, update other associated code, and clean up tests.
Implementation details
Please note that, in the context of this PR, "ACS message responder"/"responder" is more or less synonymous with "ACS message handler"/"handler".
ecs-agent/
agent/acs/handler/attach_task_eni_handler.go
->ecs-agent/acs/session/attach_task_eni_responder.go
attachTaskENIHandler
struct and existing code intoattachTaskENIResponder
struct, such thatattachTaskENIResponder
struct implements thewsclient.RequestResponder
interfaceERROR
instead ofWARN
when attach task ENI message is invalidgithub.com/aws/amazon-ecs-agent/ecs-agent/logger
instead ofgithub.com/cihub/seelog
for loggingagent/acs/handler/attach_task_eni_handler_test.go
(partial) ->agent/acs/handler/attach_task_eni_responder_test.go
agent/acs/handler/attach_task_eni_handler_test.go
(partial) ->ecs-agent/acs/session/attach_task_eni_responder_test.go
agent/acs/handler/acs_handler.go
HandlerFunc
function as a request handler to the ACS client, such that attach task ENI responder dictates what to do in response to receiving attach task ENI messages from ACSwsclient.RequestResponder
interface) that dictates what to do in response to ACS messages of that specific typeecs-agent/acs/session/testconst/test_const.go
Testing
Unit, integration, and functional tests.
New tests cover the changes: yes
Description for the changelog
Refactor ACS attach task ENI message handling
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.