Skip to content

Commit

Permalink
Remove dependency on aws-sdk-go-v2 (#3320)
Browse files Browse the repository at this point in the history
  • Loading branch information
johngmyers authored Aug 10, 2023
1 parent 4d746c5 commit 35126b2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.20

require (
github.com/aws/aws-sdk-go v1.44.294
github.com/aws/aws-sdk-go-v2 v0.18.0
github.com/evanphx/json-patch v5.6.0+incompatible
github.com/gavv/httpexpect/v2 v2.9.0
github.com/go-logr/logr v1.2.4
Expand Down
5 changes: 0 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
github.com/aws/aws-sdk-go v1.44.294 h1:3x7GaEth+pDU9HwFcAU0awZlEix5CEdyIZvV08SlHa8=
github.com/aws/aws-sdk-go v1.44.294/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v0.18.0 h1:qZ+woO4SamnH/eEbjM2IDLhRNwIwND/RQyVlBLp3Jqg=
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
Expand Down Expand Up @@ -205,7 +203,6 @@ github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXym
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng=
github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
Expand Down Expand Up @@ -363,7 +360,6 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
Expand Down Expand Up @@ -973,7 +969,6 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
Expand Down
18 changes: 9 additions & 9 deletions pkg/deploy/elbv2/tagging_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package elbv2

import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"

awssdk "github.com/aws/aws-sdk-go/aws"
elbv2sdk "github.com/aws/aws-sdk-go/service/elbv2"
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
Expand Down Expand Up @@ -263,15 +263,15 @@ func (m *defaultTaggingManager) listLoadBalancersRGT(ctx context.Context, tagFil
for _, tagFilter := range tagFilters {
req := &resourcegroupstaggingapi.GetResourcesInput{
TagFilters: convertTagFiltersToRGTTagFilters(tagFilter),
ResourceTypeFilters: aws.StringSlice([]string{services.ResourceTypeELBLoadBalancer}),
ResourceTypeFilters: awssdk.StringSlice([]string{services.ResourceTypeELBLoadBalancer}),
}
resources, err := m.rgt.GetResourcesAsList(ctx, req)
if err != nil {
return nil, err
}
for _, resource := range resources {
if _, exists := resourceTagsByARN[aws.StringValue(resource.ResourceARN)]; !exists {
resourceTagsByARN[aws.StringValue(resource.ResourceARN)] = resource.Tags
if _, exists := resourceTagsByARN[awssdk.StringValue(resource.ResourceARN)]; !exists {
resourceTagsByARN[awssdk.StringValue(resource.ResourceARN)] = resource.Tags
}
}
}
Expand Down Expand Up @@ -342,15 +342,15 @@ func (m *defaultTaggingManager) listTargetGroupsRGT(ctx context.Context, tagFilt
for _, tagFilter := range tagFilters {
req := &resourcegroupstaggingapi.GetResourcesInput{
TagFilters: convertTagFiltersToRGTTagFilters(tagFilter),
ResourceTypeFilters: aws.StringSlice([]string{services.ResourceTypeELBTargetGroup}),
ResourceTypeFilters: awssdk.StringSlice([]string{services.ResourceTypeELBTargetGroup}),
}
resources, err := m.rgt.GetResourcesAsList(ctx, req)
if err != nil {
return nil, err
}
for _, resource := range resources {
if _, exists := resourceTagsByARN[aws.StringValue(resource.ResourceARN)]; !exists {
resourceTagsByARN[aws.StringValue(resource.ResourceARN)] = resource.Tags
if _, exists := resourceTagsByARN[awssdk.StringValue(resource.ResourceARN)]; !exists {
resourceTagsByARN[awssdk.StringValue(resource.ResourceARN)] = resource.Tags
}
}
}
Expand Down Expand Up @@ -466,8 +466,8 @@ func convertTagFiltersToRGTTagFilters(tagFilter tracking.TagFilter) []*resourceg
var RGTTagFilters []*resourcegroupstaggingapi.TagFilter
for k, v := range tagFilter {
RGTTagFilters = append(RGTTagFilters, &resourcegroupstaggingapi.TagFilter{
Key: aws.String(k),
Values: aws.StringSlice(v),
Key: awssdk.String(k),
Values: awssdk.StringSlice(v),
})
}
return RGTTagFilters
Expand Down

0 comments on commit 35126b2

Please sign in to comment.