Skip to content

Commit

Permalink
fix after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
tinnywang committed Dec 10, 2024
1 parent ad1447c commit 7d2a689
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 258 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions ecs-agent/ec2/ec2_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/aws/aws-sdk-go-v2/config"
ec2sdk "github.com/aws/aws-sdk-go-v2/service/ec2"
"github.com/aws/aws-sdk-go-v2/service/ec2/types"
ecstypes "github.com/aws/aws-sdk-go-v2/service/ecs/types"
)

const (
Expand All @@ -41,7 +42,7 @@ const (

type Client interface {
CreateTags(input *ec2sdk.CreateTagsInput) (*ec2sdk.CreateTagsOutput, error)
DescribeECSTagsForInstance(instanceID string) ([]types.Tag, error)
DescribeECSTagsForInstance(instanceID string) ([]ecstypes.Tag, error)
}

type ClientSDK interface {
Expand Down Expand Up @@ -82,7 +83,7 @@ func (c *ClientImpl) SetClientSDK(sdk ClientSDK) {

// DescribeECSTagsForInstance calls DescribeTags API to get the EC2 tags of the
// instance id, and return it back as ECS tags
func (c *ClientImpl) DescribeECSTagsForInstance(instanceID string) ([]types.Tag, error) {
func (c *ClientImpl) DescribeECSTagsForInstance(instanceID string) ([]ecstypes.Tag, error) {
describeTagsInput := ec2sdk.DescribeTagsInput{
Filters: []types.Filter{
{
Expand All @@ -103,13 +104,13 @@ func (c *ClientImpl) DescribeECSTagsForInstance(instanceID string) ([]types.Tag,
return nil, err
}

var tags []types.Tag
var tags []ecstypes.Tag
// Convert ec2 tags to ecs tags
for _, ec2Tag := range res.Tags {
// Filter out all tags "aws:" prefix
if !strings.HasPrefix(strings.ToLower(aws.ToString(ec2Tag.Key)), awsTagPrefix) &&
!strings.HasPrefix(strings.ToLower(aws.ToString(ec2Tag.Value)), awsTagPrefix) {
tags = append(tags, types.Tag{
tags = append(tags, ecstypes.Tag{
Key: ec2Tag.Key,
Value: ec2Tag.Value,
})
Expand Down
2 changes: 1 addition & 1 deletion ecs-agent/ec2/mocks/ec2_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion ecs-agent/vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ github.com/aws/aws-sdk-go/internal/sync/singleflight
github.com/aws/aws-sdk-go/private/model/api
github.com/aws/aws-sdk-go/private/protocol
github.com/aws/aws-sdk-go/private/protocol/json/jsonutil
github.com/aws/aws-sdk-go/private/protocol/jsonrpc
github.com/aws/aws-sdk-go/private/protocol/rest
github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil
github.com/aws/aws-sdk-go/private/util
Expand Down

0 comments on commit 7d2a689

Please sign in to comment.