-
Notifications
You must be signed in to change notification settings - Fork 617
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
Refactor ACS attach instance ENI message handling #3765
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is HandleENIAttachment
Implemented differently by ec2 and fargate? How different are they? Can it be put into ecs-agent module too?
|
Thanks! |
7b55792
to
83f19e0
Compare
83f19e0
to
330cc25
Compare
Summary
Refactor ACS attach instance ENI message handling, clean up tests, and minor general refactor (mainly naming + file structure) of some items relevant to ACS responders dealing with ENI attachment.
Implementation details
This pull request has been split into two commits for easier readability of separation between attach instance ENI refactoring specific changes and general ENI minor refactoring changes.
Please note that, in the context of this PR, "ACS message responder"/"responder" is more or less synonymous with "ACS message handler"/"handler".
--- COMMIT 1 (click here to view associated changes) ---
ecs-agent/acs/session/testconst/test_const.go
ValidateTaskENI
function inecs-agent/api/eni/eni.go
toValidateENI
as its usage is not restricted/specific to task ENINewAttachTaskENIResponder
function inecs-agent/acs/session/attach_task_eni_responder.go
to return typewsclient.RequestResponder
instead of*attachTaskENIResponder
ecs-agent/acs/session/attach_task_eni_responder.go
with its own separate functionsendAck
function fromagent/acs/handler/attach_eni_handler_common.go
as this function is no longer used/needed after the changes from this pull request--- COMMIT 2 (click here to view associated changes) ---
ecs-agent/
agent/acs/handler/attach_instance_eni_handler.go
->ecs-agent/acs/session/attach_instance_eni_responder.go
attachInstanceENIHandler
struct and existing code intoattachInstanceENIResponder
struct, such thatattachInstanceENIResponder
struct implements thewsclient.RequestResponder
interfaceERROR
instead ofWARN
when attach instance ENI message is invalidgithub.com/aws/amazon-ecs-agent/ecs-agent/logger
instead ofgithub.com/cihub/seelog
for loggingagent/acs/handler/attach_instance_eni_handler_test.go
(partial) ->agent/acs/handler/attach_instance_eni_responder_test.go
agent/acs/handler/attach_instance_eni_handler_test.go
(partial) ->ecs-agent/acs/session/attach_instance_eni_responder_test.go
agent/acs/handler/acs_handler.go
HandlerFunc
function as a request handler to the ACS client, such that attach instance ENI responder dictates what to do in response to receiving attach instance ENI messages from ACSwsclient.RequestResponder
interface) that dictates what to do in response to ACS messages of that specific typeTesting
Unit, integration, and functional tests.
New tests cover the changes: yes
Description for the changelog
Refactor ACS attach instance 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.