Skip to content

Commit

Permalink
Update aws go sdk v2 (#7083)
Browse files Browse the repository at this point in the history
  • Loading branch information
nopcoder authored Nov 30, 2023
1 parent b7fc084 commit 32a7dcb
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 108 deletions.
4 changes: 2 additions & 2 deletions esti/adapters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"strings"
"time"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/feature/s3/manager"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/aws/aws-sdk-go/aws"
"github.com/treeverse/lakefs/pkg/api/helpers"
)

Expand Down Expand Up @@ -88,7 +88,7 @@ func (s *s3Adapter) Upload(ctx context.Context, physicalAddress *url.URL, conten
}
return ObjectStats{
Size: size,
ETag: aws.StringValue(out.ETag),
ETag: aws.ToString(out.ETag),
// S3Manager Upload does not return creation time.
}, nil
}
Expand Down
12 changes: 5 additions & 7 deletions esti/multipart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import (
"sync"
"testing"

"github.com/aws/aws-sdk-go-v2/service/s3/types"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/s3"

"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/thanhpk/randstr"
Expand Down Expand Up @@ -147,7 +145,7 @@ func uploadMultipartParts(t *testing.T, ctx context.Context, logger logging.Logg

// verify upload completed successfully
for i, err := range errs {
partNumber := int32(firstIndex + i + 1)
partNumber := aws.Int32(int32(firstIndex + i + 1))
assert.NoErrorf(t, err, "error while upload part number %d", partNumber)
// verify part number
assert.Equal(t, partNumber, completedParts[i].PartNumber, "inconsistent part number")
Expand All @@ -172,9 +170,9 @@ func uploadMultipartPart(ctx context.Context, logger logging.Logger, svc *s3.Cli
Body: bytes.NewReader(fileBytes),
Bucket: resp.Bucket,
Key: resp.Key,
PartNumber: int32(partNumber),
PartNumber: aws.Int32(int32(partNumber)),
UploadId: resp.UploadId,
ContentLength: int64(len(fileBytes)),
ContentLength: aws.Int64(int64(len(fileBytes))),
}

uploadResult, err := svc.UploadPart(ctx, partInput)
Expand All @@ -186,6 +184,6 @@ func uploadMultipartPart(ctx context.Context, logger logging.Logger, svc *s3.Cli

return types.CompletedPart{
ETag: uploadResult.ETag,
PartNumber: int32(partNumber),
PartNumber: aws.Int32(int32(partNumber)),
}, nil
}
51 changes: 25 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,17 @@ require (
github.com/Shopify/go-lua v0.0.0-20221004153744-91867de107cf
github.com/alitto/pond v1.8.3
github.com/antonmedv/expr v1.15.3
github.com/aws/aws-sdk-go v1.45.25
github.com/aws/aws-sdk-go-v2 v1.21.2
github.com/aws/aws-sdk-go-v2/config v1.18.45
github.com/aws/aws-sdk-go-v2/credentials v1.13.43
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.10.42
github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.4.69
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.90
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.22.2
github.com/aws/aws-sdk-go-v2/service/glue v1.63.0
github.com/aws/aws-sdk-go-v2/service/s3 v1.40.2
github.com/aws/aws-sdk-go-v2/service/sts v1.23.2
github.com/aws/smithy-go v1.15.0
github.com/aws/aws-sdk-go-v2 v1.23.4
github.com/aws/aws-sdk-go-v2/config v1.25.10
github.com/aws/aws-sdk-go-v2/credentials v1.16.8
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.12.7
github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.6.7
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.3
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.26.1
github.com/aws/aws-sdk-go-v2/service/glue v1.71.1
github.com/aws/aws-sdk-go-v2/service/s3 v1.47.1
github.com/aws/aws-sdk-go-v2/service/sts v1.26.1
github.com/aws/smithy-go v1.18.1
github.com/benburkert/dns v0.0.0-20190225204957-d356cf78cdfc
github.com/dgraph-io/badger/v4 v4.2.0
github.com/georgysavva/scany/v2 v2.0.0
Expand All @@ -104,20 +103,20 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect
github.com/apache/arrow/go/arrow v0.0.0-20200730104253-651201b0f516 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.14 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.6 // indirect
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.15.7 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.15 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.38 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.37 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.6 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.3 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.8 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.7 // indirect
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.18.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.7 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.8.7 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.7 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.7 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.18.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.1 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/getsentry/sentry-go v0.16.0 // indirect
github.com/go-sql-driver/mysql v1.7.0 // indirect
Expand Down
Loading

0 comments on commit 32a7dcb

Please sign in to comment.