Skip to content

Commit

Permalink
chore(nodeadm): remove aws sdk v1 refs
Browse files Browse the repository at this point in the history
  • Loading branch information
ndbaker1 committed Jul 16, 2024
1 parent 958d6fc commit 4903483
Show file tree
Hide file tree
Showing 75 changed files with 7 additions and 56,812 deletions.
1 change: 0 additions & 1 deletion nodeadm/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/awslabs/amazon-eks-ami/nodeadm
go 1.22.5

require (
github.com/aws/aws-sdk-go v1.54.19
github.com/aws/aws-sdk-go-v2/config v1.27.26
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11
github.com/aws/aws-sdk-go-v2/service/ec2 v1.170.0
Expand Down
2 changes: 0 additions & 2 deletions nodeadm/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/aws/aws-sdk-go v1.54.19 h1:tyWV+07jagrNiCcGRzRhdtVjQs7Vy41NwsuOcl0IbVI=
github.com/aws/aws-sdk-go v1.54.19/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY=
github.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc=
github.com/aws/aws-sdk-go-v2/config v1.27.26 h1:T1kAefbKuNum/AbShMsZEro6eRkeOT8YILfE9wyjAYQ=
Expand Down
6 changes: 3 additions & 3 deletions nodeadm/internal/api/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"io"
"time"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/feature/ec2/imds"
"github.com/aws/aws-sdk-go-v2/service/ec2"
"github.com/aws/aws-sdk-go/aws"
ec2extra "github.com/awslabs/amazon-eks-ami/nodeadm/internal/aws/ec2"
)

Expand Down Expand Up @@ -59,13 +59,13 @@ func getPrivateDNSName(ec2Client *ec2.Client, instanceID string) (string, error)
if err != nil {
return "", err
}
privateDNSName := aws.StringValue(out.Reservations[0].Instances[0].PrivateDnsName)
privateDNSName := aws.ToString(out.Reservations[0].Instances[0].PrivateDnsName)
return privateDNSName, nil
}

func privateDNSNameAvailable(out *ec2.DescribeInstancesOutput) (bool, error) {
if out == nil || len(out.Reservations) != 1 || len(out.Reservations[0].Instances) != 1 {
return false, fmt.Errorf("reservation or instance not found")
}
return aws.StringValue(out.Reservations[0].Instances[0].PrivateDnsName) != "", nil
return aws.ToString(out.Reservations[0].Instances[0].PrivateDnsName) != "", nil
}
7 changes: 4 additions & 3 deletions nodeadm/internal/util/ec2_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package util
package util_test

import (
"context"
"errors"
"fmt"
"testing"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/ec2"
"github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/aws/aws-sdk-go/aws"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"testing"
)

type MockEC2Client struct {
Expand Down
202 changes: 0 additions & 202 deletions nodeadm/vendor/github.com/aws/aws-sdk-go/LICENSE.txt

This file was deleted.

3 changes: 0 additions & 3 deletions nodeadm/vendor/github.com/aws/aws-sdk-go/NOTICE.txt

This file was deleted.

Loading

0 comments on commit 4903483

Please sign in to comment.