-
Notifications
You must be signed in to change notification settings - Fork 632
Migrate ACS to sdk-go-v2 #4534
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
Migrate ACS to sdk-go-v2 #4534
Conversation
5d4eab1
to
f3cae1d
Compare
fc35da9
to
ba2579f
Compare
a8dc5bb
to
59f5fc5
Compare
Update credential manager to use v2 aws Update eni to use v2 aws Update acs client test to use v2 aws Update netlib to use v2 aws Update ecs-agent/acs session to use v2 aws and aws arn Update taskresource to use v2 aws Update appmesh api to use v2 aws Update serviceconnect api to use v2 aws Update task api to use v2 aws Update acs updater to use v2 aws Update acs session to use v2 aws Add ACS model and generate client Replace acs model to the generated acs client Migrate ACS Error Types and Input/Message Migrate HeartbeatMessage/HeartbeatInput and HeartbeatAckRequest/HeartbeatOutput Migrate IAMRoleCredentialsMessage/RefreshTaskIAMRoleCredentialsInput and IAMRoleCredentialsAckRequest/RefreshTaskIAMRoleCredentialsOutput The main differences for RefreshTaskIAMRoleCredentialsInput are: - RoleType is now a string (not string pointer) enum - RoleCredentials is now acstypes.IAMRoleCredentials RefreshTaskIAMRoleCredentialsOutput stays the same. Migrate TaskStopVerificationMessage/TaskStopVerificationInput and TaskStopVerificationAck/TaskStopVerificationOutput - TaskStopVerificationMessage/TaskStopVerificationInput changed StopCandidates from []*TaskIdentifier to []types.TaskIdentifier - TaskStopVerificationAck/TaskStopVerificationOutput changed StopTasks from []*TaskIdentifier to []types.TaskIdentifier - TaskIdentifier itself remains unchanged but need to update import Migrate CloseMessage to PollOutput - Not seeing CloseMessage is being used somewhere elses so this is a simple name change - Both have the same structs anyway Migrate NackRequest to UpdateFailureInput - Struct types are the same for both - Rename helper function use for updater_test Update PerformUpdateMessage to PerformUpdateInput - Same Struct Types - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use PerformUpdateOutput Update StageUpdateMessage to StageUpdateInput - Same Struct Types - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use StageUpdateOutput Migrate AttachTaskNetworkInterfacesMessage to AttachTaskNetworkInterfacesInput - ElasticNetworkInterfaces []*ElasticNetworkInterface -> []types.ElasticNetworkInterface - ElasticNetworkInterfaces - DomainName []*string -> []string - DomainNameServers []*string -> []string - Index *int64 -> *int32 - InterfaceAssociationProtocol *string -> NetworkInterfaceAssociationProtocol (string enum) - Ipv4Addresses []*IPv4AddressAssignment -> []IPv4AddressAssignment - Ipv6Addresses []*IPv6AddressAssignment -> []IPv6AddressAssignment - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use AttachTaskNetworkInterfacesOutput Migrate ElasticNetworkInterfaces - DomainName []*string -> []string - DomainNameServers []*string -> []string - Index *int64 -> *int32 - InterfaceAssociationProtocol *string -> NetworkInterfaceAssociationProtocol (string enum) - Ipv4Addresses []*IPv4AddressAssignment -> []IPv4AddressAssignment - Ipv6Addresses []*IPv6AddressAssignment -> []IPv6AddressAssignment Migrate AttachInstanceNetworkInterfacesMessage to AttachInstanceNetworkInterfacesInput - ElasticNetworkInterfaces []*ElasticNetworkInterface -> []types.ElasticNetworkInterface - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use AttachInstanceNetworkInterfacesOutput Migrate ConfirmAttachmentMessage to ConfirmAttachmentInput - *types.Attachment - AttachmentProperties []*AttachmentProperty → []AttachmentProperty - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use ConfirmAttachmentOutput Migrate Attachment to types.Attachment - AttachmentProperties []*AttachmentProperty → []AttachmentProperty Migrate TaskManifestMessage to TaskManifestInput - Tasks []*TaskIdentifier → [] types.TaskIdentifier - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use TaskManifestOutput Migrate ecsacs.Task's Attachments Migrate PayloadMessage to PayloadInput - Also migrate underlying structs like Task, Container,... Migrate ecsacs.UpdateInfo to types.UpdateInfo Remove v1 acs model. Introduce AckRequest as a generic struct. Refactor: update acs import path to avoid conflict with ecsacs model Introduce Prettify util function; Migrate struct.String to Prettify(struct) - It's important to redact sensitive information - There's no longer "sensitive" tags in sdk v2 Migrate LinuxParameters and KernelCapabilities to use ecs types - Use the predefined ecs types instead of manually defining ones Fix: go staticcheck Fix: change the TaskVolume keynames to starting with uppercase Replace jsonutils.BuildJSON/json.Marshal, jsonutil.UnmarshalJSON/json.Unmarshal, and Message_/Message - inlcluded task api and wsclient - exclude tcs client (out of scope) Fix: cast AuthenticationType and FirelensConfigurationType to string before asserting equality Fix: Check against an empty string as the default value for PortMapping's Protocol - PortMapping's Protocol changed from *string -> TransportProtocol (string enum) - The zero value is thus updated from null -> `""` empty string go mod tidy && go mod vendor make gogenerate go mod tidy && go mod vendor Fix: change field names starting with Uppercase Fix: Handle pointer referencing error from AttachmentProperties Migration Fix: handle pointer error for ecs-agent netlib test Fix: misc type fixes Migrate Websocket and TCS to v2 credentials go mod tidy, go mod vendor, gogenerate, go mod tidy, go mod vendor Fix: Alias ACS types
This reverts commit 1ddf21e. Revert "go mod tidy, go mod vendor, gogenerate, go mod tidy, go mod vendor" This reverts commit d736279. Revert "Migrate Websocket and TCS to v2 credentials" This reverts commit 5eeec98. Revert "Fix: misc type fixes" This reverts commit d1d87e2. Revert "Fix: handle pointer error for ecs-agent netlib test" This reverts commit 080d85d. Revert "Fix: Handle pointer referencing error from AttachmentProperties Migration" This reverts commit f2b2dfd. Revert "Fix: change field names starting with Uppercase" This reverts commit ad9e2f8. Revert "go mod tidy && go mod vendor" This reverts commit 7fe7b77. Revert "make gogenerate" This reverts commit 4144e5e. Revert "go mod tidy && go mod vendor" This reverts commit 36dde8b. Revert "Fix: Check against an empty string as the default value for PortMapping's Protocol" This reverts commit 23c8c44. Revert "Fix: cast AuthenticationType and FirelensConfigurationType to string before asserting equality" This reverts commit 14436be. Revert "Replace jsonutils.BuildJSON/json.Marshal, jsonutil.UnmarshalJSON/json.Unmarshal, and Message_/Message" This reverts commit 3c70e74. Revert "Fix: change the TaskVolume keynames to starting with uppercase" This reverts commit 4055255. Revert "Fix: go staticcheck" This reverts commit 9bc7255. Revert "Migrate LinuxParameters and KernelCapabilities to use ecs types" This reverts commit 0927318. Revert "Introduce Prettify util function; Migrate struct.String to Prettify(struct)" This reverts commit 1bb4bbb. Revert "Refactor: update acs import path to avoid conflict with ecsacs model" This reverts commit c0fcae0. Revert "Remove v1 acs model. Introduce AckRequest as a generic struct." This reverts commit d924b17. Revert "Migrate ecsacs.UpdateInfo to types.UpdateInfo" This reverts commit d2e19f2. Revert "Migrate PayloadMessage to PayloadInput" This reverts commit 7d3282b. Revert "Migrate ecsacs.Task's Attachments" This reverts commit 3452c4a. Revert "Migrate TaskManifestMessage to TaskManifestInput" This reverts commit 0a51a28. Revert "Migrate Attachment to types.Attachment" This reverts commit 78d779f. Revert "Migrate ConfirmAttachmentMessage to ConfirmAttachmentInput" This reverts commit 884d99f. Revert "Migrate AttachInstanceNetworkInterfacesMessage to AttachInstanceNetworkInterfacesInput" This reverts commit fc7adc2. Revert "Migrate ElasticNetworkInterfaces" This reverts commit b123368. Revert "Migrate AttachTaskNetworkInterfacesMessage to AttachTaskNetworkInterfacesInput" This reverts commit b0663ce. Revert "Update StageUpdateMessage to StageUpdateInput" This reverts commit 7c704cf. Revert "Update PerformUpdateMessage to PerformUpdateInput" This reverts commit c47d6be. Revert "Migrate NackRequest to UpdateFailureInput" This reverts commit 2f38c52. Revert "Migrate CloseMessage to PollOutput" This reverts commit d35c5e1. Revert "Migrate TaskStopVerificationMessage/TaskStopVerificationInput and TaskStopVerificationAck/TaskStopVerificationOutput" This reverts commit fd1f79f. Revert "Migrate IAMRoleCredentialsMessage/RefreshTaskIAMRoleCredentialsInput and IAMRoleCredentialsAckRequest/RefreshTaskIAMRoleCredentialsOutput" This reverts commit 2b91941. Revert "Migrate HeartbeatMessage/HeartbeatInput and HeartbeatAckRequest/HeartbeatOutput" This reverts commit 2fa86ca. Revert "Migrate ACS Error Types and Input/Message" This reverts commit 29e7332. Revert "Replace acs model to the generated acs client" This reverts commit 9db9b92. Revert "Add ACS model and generate client" This reverts commit cea3f80.
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.
Minor comment, LGTM
@@ -7,7 +7,7 @@ toolchain go1.23.7 | |||
require ( | |||
github.com/aws/amazon-ecs-agent/ecs-agent v0.0.0 | |||
github.com/aws/aws-sdk-go v1.51.3 | |||
github.com/aws/aws-sdk-go-v2 v1.32.6 | |||
github.com/aws/aws-sdk-go-v2 v1.36.2 |
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 there a reason to move backward here?
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.
Hm we've bumped up the version instead of downgrading. Could you clarify what you mean by "moving backwards"?
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.
Whoops, I misread this it seems. I was seeing v1.36.6
and not v1.32.6
* Update wsclient to use v2 aws Update credential manager to use v2 aws Update eni to use v2 aws Update acs client test to use v2 aws Update netlib to use v2 aws Update ecs-agent/acs session to use v2 aws and aws arn Update taskresource to use v2 aws Update appmesh api to use v2 aws Update serviceconnect api to use v2 aws Update task api to use v2 aws Update acs updater to use v2 aws Update acs session to use v2 aws Add ACS model and generate client Replace acs model to the generated acs client Migrate ACS Error Types and Input/Message Migrate HeartbeatMessage/HeartbeatInput and HeartbeatAckRequest/HeartbeatOutput Migrate IAMRoleCredentialsMessage/RefreshTaskIAMRoleCredentialsInput and IAMRoleCredentialsAckRequest/RefreshTaskIAMRoleCredentialsOutput The main differences for RefreshTaskIAMRoleCredentialsInput are: - RoleType is now a string (not string pointer) enum - RoleCredentials is now acstypes.IAMRoleCredentials RefreshTaskIAMRoleCredentialsOutput stays the same. Migrate TaskStopVerificationMessage/TaskStopVerificationInput and TaskStopVerificationAck/TaskStopVerificationOutput - TaskStopVerificationMessage/TaskStopVerificationInput changed StopCandidates from []*TaskIdentifier to []types.TaskIdentifier - TaskStopVerificationAck/TaskStopVerificationOutput changed StopTasks from []*TaskIdentifier to []types.TaskIdentifier - TaskIdentifier itself remains unchanged but need to update import Migrate CloseMessage to PollOutput - Not seeing CloseMessage is being used somewhere elses so this is a simple name change - Both have the same structs anyway Migrate NackRequest to UpdateFailureInput - Struct types are the same for both - Rename helper function use for updater_test Update PerformUpdateMessage to PerformUpdateInput - Same Struct Types - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use PerformUpdateOutput Update StageUpdateMessage to StageUpdateInput - Same Struct Types - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use StageUpdateOutput Migrate AttachTaskNetworkInterfacesMessage to AttachTaskNetworkInterfacesInput - ElasticNetworkInterfaces []*ElasticNetworkInterface -> []types.ElasticNetworkInterface - ElasticNetworkInterfaces - DomainName []*string -> []string - DomainNameServers []*string -> []string - Index *int64 -> *int32 - InterfaceAssociationProtocol *string -> NetworkInterfaceAssociationProtocol (string enum) - Ipv4Addresses []*IPv4AddressAssignment -> []IPv4AddressAssignment - Ipv6Addresses []*IPv6AddressAssignment -> []IPv6AddressAssignment - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use AttachTaskNetworkInterfacesOutput Migrate ElasticNetworkInterfaces - DomainName []*string -> []string - DomainNameServers []*string -> []string - Index *int64 -> *int32 - InterfaceAssociationProtocol *string -> NetworkInterfaceAssociationProtocol (string enum) - Ipv4Addresses []*IPv4AddressAssignment -> []IPv4AddressAssignment - Ipv6Addresses []*IPv6AddressAssignment -> []IPv6AddressAssignment Migrate AttachInstanceNetworkInterfacesMessage to AttachInstanceNetworkInterfacesInput - ElasticNetworkInterfaces []*ElasticNetworkInterface -> []types.ElasticNetworkInterface - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use AttachInstanceNetworkInterfacesOutput Migrate ConfirmAttachmentMessage to ConfirmAttachmentInput - *types.Attachment - AttachmentProperties []*AttachmentProperty → []AttachmentProperty - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use ConfirmAttachmentOutput Migrate Attachment to types.Attachment - AttachmentProperties []*AttachmentProperty → []AttachmentProperty Migrate TaskManifestMessage to TaskManifestInput - Tasks []*TaskIdentifier → [] types.TaskIdentifier - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use TaskManifestOutput Migrate ecsacs.Task's Attachments Migrate PayloadMessage to PayloadInput - Also migrate underlying structs like Task, Container,... Migrate ecsacs.UpdateInfo to types.UpdateInfo Remove v1 acs model. Introduce AckRequest as a generic struct. Refactor: update acs import path to avoid conflict with ecsacs model Introduce Prettify util function; Migrate struct.String to Prettify(struct) - It's important to redact sensitive information - There's no longer "sensitive" tags in sdk v2 Migrate LinuxParameters and KernelCapabilities to use ecs types - Use the predefined ecs types instead of manually defining ones Fix: go staticcheck Fix: change the TaskVolume keynames to starting with uppercase Replace jsonutils.BuildJSON/json.Marshal, jsonutil.UnmarshalJSON/json.Unmarshal, and Message_/Message - inlcluded task api and wsclient - exclude tcs client (out of scope) Fix: cast AuthenticationType and FirelensConfigurationType to string before asserting equality Fix: Check against an empty string as the default value for PortMapping's Protocol - PortMapping's Protocol changed from *string -> TransportProtocol (string enum) - The zero value is thus updated from null -> `""` empty string go mod tidy && go mod vendor make gogenerate go mod tidy && go mod vendor Fix: change field names starting with Uppercase Fix: Handle pointer referencing error from AttachmentProperties Migration Fix: handle pointer error for ecs-agent netlib test Fix: misc type fixes Migrate Websocket and TCS to v2 credentials go mod tidy, go mod vendor, gogenerate, go mod tidy, go mod vendor Fix: Alias ACS types * Revert "Fix: Alias ACS types" This reverts commit 1ddf21e. Revert "go mod tidy, go mod vendor, gogenerate, go mod tidy, go mod vendor" This reverts commit d736279. Revert "Migrate Websocket and TCS to v2 credentials" This reverts commit 5eeec98. Revert "Fix: misc type fixes" This reverts commit d1d87e2. Revert "Fix: handle pointer error for ecs-agent netlib test" This reverts commit 080d85d. Revert "Fix: Handle pointer referencing error from AttachmentProperties Migration" This reverts commit f2b2dfd. Revert "Fix: change field names starting with Uppercase" This reverts commit ad9e2f8. Revert "go mod tidy && go mod vendor" This reverts commit 7fe7b77. Revert "make gogenerate" This reverts commit 4144e5e. Revert "go mod tidy && go mod vendor" This reverts commit 36dde8b. Revert "Fix: Check against an empty string as the default value for PortMapping's Protocol" This reverts commit 23c8c44. Revert "Fix: cast AuthenticationType and FirelensConfigurationType to string before asserting equality" This reverts commit 14436be. Revert "Replace jsonutils.BuildJSON/json.Marshal, jsonutil.UnmarshalJSON/json.Unmarshal, and Message_/Message" This reverts commit 3c70e74. Revert "Fix: change the TaskVolume keynames to starting with uppercase" This reverts commit 4055255. Revert "Fix: go staticcheck" This reverts commit 9bc7255. Revert "Migrate LinuxParameters and KernelCapabilities to use ecs types" This reverts commit 0927318. Revert "Introduce Prettify util function; Migrate struct.String to Prettify(struct)" This reverts commit 1bb4bbb. Revert "Refactor: update acs import path to avoid conflict with ecsacs model" This reverts commit c0fcae0. Revert "Remove v1 acs model. Introduce AckRequest as a generic struct." This reverts commit d924b17. Revert "Migrate ecsacs.UpdateInfo to types.UpdateInfo" This reverts commit d2e19f2. Revert "Migrate PayloadMessage to PayloadInput" This reverts commit 7d3282b. Revert "Migrate ecsacs.Task's Attachments" This reverts commit 3452c4a. Revert "Migrate TaskManifestMessage to TaskManifestInput" This reverts commit 0a51a28. Revert "Migrate Attachment to types.Attachment" This reverts commit 78d779f. Revert "Migrate ConfirmAttachmentMessage to ConfirmAttachmentInput" This reverts commit 884d99f. Revert "Migrate AttachInstanceNetworkInterfacesMessage to AttachInstanceNetworkInterfacesInput" This reverts commit fc7adc2. Revert "Migrate ElasticNetworkInterfaces" This reverts commit b123368. Revert "Migrate AttachTaskNetworkInterfacesMessage to AttachTaskNetworkInterfacesInput" This reverts commit b0663ce. Revert "Update StageUpdateMessage to StageUpdateInput" This reverts commit 7c704cf. Revert "Update PerformUpdateMessage to PerformUpdateInput" This reverts commit c47d6be. Revert "Migrate NackRequest to UpdateFailureInput" This reverts commit 2f38c52. Revert "Migrate CloseMessage to PollOutput" This reverts commit d35c5e1. Revert "Migrate TaskStopVerificationMessage/TaskStopVerificationInput and TaskStopVerificationAck/TaskStopVerificationOutput" This reverts commit fd1f79f. Revert "Migrate IAMRoleCredentialsMessage/RefreshTaskIAMRoleCredentialsInput and IAMRoleCredentialsAckRequest/RefreshTaskIAMRoleCredentialsOutput" This reverts commit 2b91941. Revert "Migrate HeartbeatMessage/HeartbeatInput and HeartbeatAckRequest/HeartbeatOutput" This reverts commit 2fa86ca. Revert "Migrate ACS Error Types and Input/Message" This reverts commit 29e7332. Revert "Replace acs model to the generated acs client" This reverts commit 9db9b92. Revert "Add ACS model and generate client" This reverts commit cea3f80. * Update ACS and websocket clients to use V2. Keep TCS client to V1 * fixing unit tests in ecs-agent/ * Consuming V2 for ACS in agent/ * fixing go mod and vendors after rebasing --------- Co-authored-by: Thean Lim <[email protected]> Co-authored-by: mye956 <[email protected]>
* Update wsclient to use v2 aws Update credential manager to use v2 aws Update eni to use v2 aws Update acs client test to use v2 aws Update netlib to use v2 aws Update ecs-agent/acs session to use v2 aws and aws arn Update taskresource to use v2 aws Update appmesh api to use v2 aws Update serviceconnect api to use v2 aws Update task api to use v2 aws Update acs updater to use v2 aws Update acs session to use v2 aws Add ACS model and generate client Replace acs model to the generated acs client Migrate ACS Error Types and Input/Message Migrate HeartbeatMessage/HeartbeatInput and HeartbeatAckRequest/HeartbeatOutput Migrate IAMRoleCredentialsMessage/RefreshTaskIAMRoleCredentialsInput and IAMRoleCredentialsAckRequest/RefreshTaskIAMRoleCredentialsOutput The main differences for RefreshTaskIAMRoleCredentialsInput are: - RoleType is now a string (not string pointer) enum - RoleCredentials is now acstypes.IAMRoleCredentials RefreshTaskIAMRoleCredentialsOutput stays the same. Migrate TaskStopVerificationMessage/TaskStopVerificationInput and TaskStopVerificationAck/TaskStopVerificationOutput - TaskStopVerificationMessage/TaskStopVerificationInput changed StopCandidates from []*TaskIdentifier to []types.TaskIdentifier - TaskStopVerificationAck/TaskStopVerificationOutput changed StopTasks from []*TaskIdentifier to []types.TaskIdentifier - TaskIdentifier itself remains unchanged but need to update import Migrate CloseMessage to PollOutput - Not seeing CloseMessage is being used somewhere elses so this is a simple name change - Both have the same structs anyway Migrate NackRequest to UpdateFailureInput - Struct types are the same for both - Rename helper function use for updater_test Update PerformUpdateMessage to PerformUpdateInput - Same Struct Types - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use PerformUpdateOutput Update StageUpdateMessage to StageUpdateInput - Same Struct Types - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use StageUpdateOutput Migrate AttachTaskNetworkInterfacesMessage to AttachTaskNetworkInterfacesInput - ElasticNetworkInterfaces []*ElasticNetworkInterface -> []types.ElasticNetworkInterface - ElasticNetworkInterfaces - DomainName []*string -> []string - DomainNameServers []*string -> []string - Index *int64 -> *int32 - InterfaceAssociationProtocol *string -> NetworkInterfaceAssociationProtocol (string enum) - Ipv4Addresses []*IPv4AddressAssignment -> []IPv4AddressAssignment - Ipv6Addresses []*IPv6AddressAssignment -> []IPv6AddressAssignment - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use AttachTaskNetworkInterfacesOutput Migrate ElasticNetworkInterfaces - DomainName []*string -> []string - DomainNameServers []*string -> []string - Index *int64 -> *int32 - InterfaceAssociationProtocol *string -> NetworkInterfaceAssociationProtocol (string enum) - Ipv4Addresses []*IPv4AddressAssignment -> []IPv4AddressAssignment - Ipv6Addresses []*IPv6AddressAssignment -> []IPv6AddressAssignment Migrate AttachInstanceNetworkInterfacesMessage to AttachInstanceNetworkInterfacesInput - ElasticNetworkInterfaces []*ElasticNetworkInterface -> []types.ElasticNetworkInterface - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use AttachInstanceNetworkInterfacesOutput Migrate ConfirmAttachmentMessage to ConfirmAttachmentInput - *types.Attachment - AttachmentProperties []*AttachmentProperty → []AttachmentProperty - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use ConfirmAttachmentOutput Migrate Attachment to types.Attachment - AttachmentProperties []*AttachmentProperty → []AttachmentProperty Migrate TaskManifestMessage to TaskManifestInput - Tasks []*TaskIdentifier → [] types.TaskIdentifier - TODO: handle AckRequest (not a type in V2) so either create a AckRequest type or use TaskManifestOutput Migrate ecsacs.Task's Attachments Migrate PayloadMessage to PayloadInput - Also migrate underlying structs like Task, Container,... Migrate ecsacs.UpdateInfo to types.UpdateInfo Remove v1 acs model. Introduce AckRequest as a generic struct. Refactor: update acs import path to avoid conflict with ecsacs model Introduce Prettify util function; Migrate struct.String to Prettify(struct) - It's important to redact sensitive information - There's no longer "sensitive" tags in sdk v2 Migrate LinuxParameters and KernelCapabilities to use ecs types - Use the predefined ecs types instead of manually defining ones Fix: go staticcheck Fix: change the TaskVolume keynames to starting with uppercase Replace jsonutils.BuildJSON/json.Marshal, jsonutil.UnmarshalJSON/json.Unmarshal, and Message_/Message - inlcluded task api and wsclient - exclude tcs client (out of scope) Fix: cast AuthenticationType and FirelensConfigurationType to string before asserting equality Fix: Check against an empty string as the default value for PortMapping's Protocol - PortMapping's Protocol changed from *string -> TransportProtocol (string enum) - The zero value is thus updated from null -> `""` empty string go mod tidy && go mod vendor make gogenerate go mod tidy && go mod vendor Fix: change field names starting with Uppercase Fix: Handle pointer referencing error from AttachmentProperties Migration Fix: handle pointer error for ecs-agent netlib test Fix: misc type fixes Migrate Websocket and TCS to v2 credentials go mod tidy, go mod vendor, gogenerate, go mod tidy, go mod vendor Fix: Alias ACS types * Revert "Fix: Alias ACS types" This reverts commit 1ddf21e. Revert "go mod tidy, go mod vendor, gogenerate, go mod tidy, go mod vendor" This reverts commit d736279. Revert "Migrate Websocket and TCS to v2 credentials" This reverts commit 5eeec98. Revert "Fix: misc type fixes" This reverts commit d1d87e2. Revert "Fix: handle pointer error for ecs-agent netlib test" This reverts commit 080d85d. Revert "Fix: Handle pointer referencing error from AttachmentProperties Migration" This reverts commit f2b2dfd. Revert "Fix: change field names starting with Uppercase" This reverts commit ad9e2f8. Revert "go mod tidy && go mod vendor" This reverts commit 7fe7b77. Revert "make gogenerate" This reverts commit 4144e5e. Revert "go mod tidy && go mod vendor" This reverts commit 36dde8b. Revert "Fix: Check against an empty string as the default value for PortMapping's Protocol" This reverts commit 23c8c44. Revert "Fix: cast AuthenticationType and FirelensConfigurationType to string before asserting equality" This reverts commit 14436be. Revert "Replace jsonutils.BuildJSON/json.Marshal, jsonutil.UnmarshalJSON/json.Unmarshal, and Message_/Message" This reverts commit 3c70e74. Revert "Fix: change the TaskVolume keynames to starting with uppercase" This reverts commit 4055255. Revert "Fix: go staticcheck" This reverts commit 9bc7255. Revert "Migrate LinuxParameters and KernelCapabilities to use ecs types" This reverts commit 0927318. Revert "Introduce Prettify util function; Migrate struct.String to Prettify(struct)" This reverts commit 1bb4bbb. Revert "Refactor: update acs import path to avoid conflict with ecsacs model" This reverts commit c0fcae0. Revert "Remove v1 acs model. Introduce AckRequest as a generic struct." This reverts commit d924b17. Revert "Migrate ecsacs.UpdateInfo to types.UpdateInfo" This reverts commit d2e19f2. Revert "Migrate PayloadMessage to PayloadInput" This reverts commit 7d3282b. Revert "Migrate ecsacs.Task's Attachments" This reverts commit 3452c4a. Revert "Migrate TaskManifestMessage to TaskManifestInput" This reverts commit 0a51a28. Revert "Migrate Attachment to types.Attachment" This reverts commit 78d779f. Revert "Migrate ConfirmAttachmentMessage to ConfirmAttachmentInput" This reverts commit 884d99f. Revert "Migrate AttachInstanceNetworkInterfacesMessage to AttachInstanceNetworkInterfacesInput" This reverts commit fc7adc2. Revert "Migrate ElasticNetworkInterfaces" This reverts commit b123368. Revert "Migrate AttachTaskNetworkInterfacesMessage to AttachTaskNetworkInterfacesInput" This reverts commit b0663ce. Revert "Update StageUpdateMessage to StageUpdateInput" This reverts commit 7c704cf. Revert "Update PerformUpdateMessage to PerformUpdateInput" This reverts commit c47d6be. Revert "Migrate NackRequest to UpdateFailureInput" This reverts commit 2f38c52. Revert "Migrate CloseMessage to PollOutput" This reverts commit d35c5e1. Revert "Migrate TaskStopVerificationMessage/TaskStopVerificationInput and TaskStopVerificationAck/TaskStopVerificationOutput" This reverts commit fd1f79f. Revert "Migrate IAMRoleCredentialsMessage/RefreshTaskIAMRoleCredentialsInput and IAMRoleCredentialsAckRequest/RefreshTaskIAMRoleCredentialsOutput" This reverts commit 2b91941. Revert "Migrate HeartbeatMessage/HeartbeatInput and HeartbeatAckRequest/HeartbeatOutput" This reverts commit 2fa86ca. Revert "Migrate ACS Error Types and Input/Message" This reverts commit 29e7332. Revert "Replace acs model to the generated acs client" This reverts commit 9db9b92. Revert "Add ACS model and generate client" This reverts commit cea3f80. * Update ACS and websocket clients to use V2. Keep TCS client to V1 * fixing unit tests in ecs-agent/ * Consuming V2 for ACS in agent/ * fixing go mod and vendors after rebasing --------- Co-authored-by: Thean Lim <[email protected]> Co-authored-by: mye956 <[email protected]>
Summary
This PR will look to migrate our ACS implementations and corresponding files over to AWS SDK Go V2.
Note: There are some overlapping files that both ACS and TCS consumes. To just migrate ACS over to V2, temporary changes that still uses AWS SDK Go V1 will be made for TCS and should be removed/modified when it's ready to be migrated to V2.
AWS SDK Go V2 Migration Public Doc: https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/migrate-gosdk.html
Implementation details
ClientServerImpl
struct fromwsclient
with a new field calledCredentialCache
of typeaws.CredentialsCache
from AWS SDK Go V2. IfCredentialProvider
has been set then it continue to use AWS SDK Go V1 to sign the HTTP requests, otherwise use AWS SDK Go V2 to sign the HTTP requests.ClientFactory
interface fromwsclient
to also useaws.CredentialsCache
as part ofNew(...)
functionalityecs-agent
to usecredentialCache
of typeCredentialsCache
from AWS SDK Go V2 instead ofCredentials
from AWS SDK Go V1.SignHTTPRequest
inecs-agent/utils/sign_http_request.go
to useaws.CredentialsCache
instead ofCredentials
as well asSignHTTP()
fromaws-sdk-go-v2/aws/signer/v4
. We will also need to pass in a hex encoded SHA-256 hash of the request body now.SIgnHTTPRequest
that still uses AWS SDK Go V1 toSignHTTPRequestV1
so that TCS isn't affected from this changeecs-agent/
to useSignHTTPRequestV1
for now until we've migrated over to V2aws.*Value()
toaws.To*()
aws-sdk-go/
toaws-sdk-go-v2/
Testing
ecs-agent/wsclient/client_test.go
specifically, added two separate test cases for most of the tests where both V1 and V2 can be usedNew tests cover the changes:
Description for the changelog
Enhancement - Migrate ACS over to AWS SDK Go V2
Additional Information
Does this PR include breaking model changes? If so, Have you added transformation functions?
Does this PR include the addition of new environment variables in the README?
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.