From 1190cb8d21506bf061a71fba13310fb3ff2a7fcc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 16:46:19 +0000 Subject: [PATCH 1/2] go.mod: Bump github.com/aws/aws-sdk-go-v2/service/s3 Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.42.2 to 1.44.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.42.2...service/s3/v1.44.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/s3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 31602479..a635c453 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/aws/aws-sdk-go-v2 v1.23.1 github.com/aws/aws-sdk-go-v2/config v1.25.5 github.com/aws/aws-sdk-go-v2/credentials v1.16.4 - github.com/aws/aws-sdk-go-v2/service/s3 v1.42.2 + github.com/aws/aws-sdk-go-v2/service/s3 v1.44.0 github.com/axiomhq/axiom-go v0.17.2 github.com/bradleyfalzon/ghinstallation/v2 v2.8.0 github.com/fatih/color v1.16.0 @@ -132,11 +132,11 @@ require ( github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 // 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.3 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.4 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.4 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.4 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.4 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.17.3 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.1 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.25.4 // indirect diff --git a/go.sum b/go.sum index d705bc82..7d7037cf 100644 --- a/go.sum +++ b/go.sum @@ -59,18 +59,18 @@ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4 h1:4GV0kKZzUxiWxSVpn/9 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.4/go.mod h1:dYvTNAggxDZy6y1AF7YDwXsPuHFy/VNEpEI/2dWK9IU= github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 h1:uR9lXYjdPX0xY+NhvaJ4dD8rpSRz5VY81ccIIoNG+lw= github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.3 h1:lMwCXiWJlrtZot0NJTjbC8G9zl+V3i68gBTBBvDeEXA= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.3/go.mod h1:5yzAuE9i2RkVAttBl8yxZgQr5OCq4D5yDnG7j9x2L0U= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.4 h1:40Q4X5ebZruRtknEZH/bg91sT5pR853F7/1X9QRbI54= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.4/go.mod h1:u77N7eEECzUv7F0xl2gcfK/vzc8wcjWobpy+DcrLJ5E= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.1 h1:rpkF4n0CyFcrJUG/rNNohoTmhtWlFTRI4BsZOh9PvLs= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.1/go.mod h1:l9ymW25HOqymeU2m1gbUQ3rUIsTwKs8gYHXkqDQUhiI= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.3 h1:xbwRyCy7kXrOj89iIKLB6NfE2WCpP9HoKyk8dMDvnIQ= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.3/go.mod h1:R+/S1O4TYpcktbVwddeOYg+uwUfLhADP2S/x4QwsCTM= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.4 h1:6DRKQc+9cChgzL5gplRGusI5dBGeiEod4m/pmGbcX48= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.4/go.mod h1:s8ORvrW4g4v7IvYKIAoBg17w3GQ+XuwXDXYrQ5SkzU0= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.4 h1:rdovz3rEu0vZKbzoMYPTehp0E8veoE9AyfzqCr5Eeao= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.4/go.mod h1:aYCGNjyUCUelhofxlZyj63srdxWUSsBSGg5l6MCuXuE= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.3 h1:KV0z2RDc7euMtg8aUT1czv5p29zcLlXALNFsd3jkkEc= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.3/go.mod h1:KZgs2ny8HsxRIRbDwgvJcHHBZPOzQr/+NtGwnP+w2ec= -github.com/aws/aws-sdk-go-v2/service/s3 v1.42.2 h1:NnduxUd9+Fq9DcCDdJK8v6l9lR1xDX4usvog+JuQAno= -github.com/aws/aws-sdk-go-v2/service/s3 v1.42.2/go.mod h1:NXRKkiRF+erX2hnybnVU660cYT5/KChRD4iUgJ97cI8= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.4 h1:o3DcfCxGDIT20pTbVKVhp3vWXOj/VvgazNJvumWeYW0= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.4/go.mod h1:Uy0KVOxuTK2ne+/PKQ+VvEeWmjMMksE17k/2RK/r5oM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.44.0 h1:FJTWR2nP1ddLIbk4n7Glw8wGbeWGHaViUwADPzE/EBo= +github.com/aws/aws-sdk-go-v2/service/s3 v1.44.0/go.mod h1:dqJ5JBL0clzgHriH35Amx3LRFY6wNIPUX7QO/BerSBo= github.com/aws/aws-sdk-go-v2/service/sso v1.17.3 h1:CdsSOGlFF3Pn+koXOIpTtvX7st0IuGsZ8kJqcWMlX54= github.com/aws/aws-sdk-go-v2/service/sso v1.17.3/go.mod h1:oA6VjNsLll2eVuUoF2D+CMyORgNzPEW/3PyUdq6WQjI= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.1 h1:cbRqFTVnJV+KRpwFl76GJdIZJKKCdTPnjUZ7uWh3pIU= From f14ed420e35571605275b48d2eea662f83b48600 Mon Sep 17 00:00:00 2001 From: jay-dee7 Date: Fri, 24 Nov 2023 22:24:48 +0530 Subject: [PATCH 2/2] fix: Integer field changes for aws-sdk-go-v2 Signed-off-by: jay-dee7 --- dfs/filebase/filebase.go | 12 ++++++------ dfs/mock/mockFileSystem.go | 3 ++- dfs/mock/storage.go | 3 ++- dfs/storj/storj.go | 12 ++++++------ dfs/storj/uplink/uplink.go | 3 ++- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/dfs/filebase/filebase.go b/dfs/filebase/filebase.go index abe44b27..70d6455c 100644 --- a/dfs/filebase/filebase.go +++ b/dfs/filebase/filebase.go @@ -75,9 +75,9 @@ func (fb *filebase) UploadPart( Bucket: &fb.bucket, ChecksumAlgorithm: s3types.ChecksumAlgorithmSha256, ChecksumSHA256: aws.String(digest), - ContentLength: contentLength, + ContentLength: &contentLength, Key: &layerKey, - PartNumber: int32(partNumber), + PartNumber: aws.Int32(int32(partNumber)), UploadId: &uploadId, } @@ -89,7 +89,7 @@ func (fb *filebase) UploadPart( return s3types.CompletedPart{ ChecksumSHA256: &digest, ETag: resp.ETag, - PartNumber: int32(partNumber), + PartNumber: aws.Int32(int32(partNumber)), }, nil } @@ -163,7 +163,7 @@ func (fb *filebase) Upload(ctx context.Context, namespace, digest string, conten Body: bytes.NewBuffer(content), ChecksumAlgorithm: s3types.ChecksumAlgorithmSha256, ChecksumSHA256: &digest, - ContentLength: int64(len(content)), + ContentLength: aws.Int64(int64(len(content))), StorageClass: s3types.StorageClassStandard, } if fb.env == config.CI { @@ -251,7 +251,7 @@ func (fb *filebase) Metadata(identifier string) (*types.ObjectMetadata, error) { ContentType: *resp.ContentType, Etag: *resp.ETag, DFSLink: cid, - ContentLength: int(resp.ContentLength), + ContentLength: int(*resp.ContentLength), }, nil } @@ -267,7 +267,7 @@ func (fb *filebase) GetUploadProgress(identifier, uploadID string) (*types.Objec var uploadedSize int64 for _, p := range partsResp.Parts { - uploadedSize += p.Size + uploadedSize += *p.Size } return &types.ObjectMetadata{ diff --git a/dfs/mock/mockFileSystem.go b/dfs/mock/mockFileSystem.go index 5e0bf05f..420f9329 100644 --- a/dfs/mock/mockFileSystem.go +++ b/dfs/mock/mockFileSystem.go @@ -10,6 +10,7 @@ import ( "os" "strings" + "github.com/aws/aws-sdk-go-v2/aws" s3types "github.com/aws/aws-sdk-go-v2/service/s3/types" "github.com/containerish/OpenRegistry/config" "github.com/containerish/OpenRegistry/dfs" @@ -89,7 +90,7 @@ func (ms *fileBasedMockStorage) UploadPart( return s3types.CompletedPart{ ChecksumCRC32: &digest, ChecksumCRC32C: &layerKey, - PartNumber: int32(partNumber), + PartNumber: aws.Int32(int32(partNumber)), }, nil } diff --git a/dfs/mock/storage.go b/dfs/mock/storage.go index 2e6583e7..ecc39c3a 100644 --- a/dfs/mock/storage.go +++ b/dfs/mock/storage.go @@ -10,6 +10,7 @@ import ( "os" "strings" + "github.com/aws/aws-sdk-go-v2/aws" s3types "github.com/aws/aws-sdk-go-v2/service/s3/types" "github.com/containerish/OpenRegistry/config" "github.com/containerish/OpenRegistry/dfs" @@ -83,7 +84,7 @@ func (ms *memMappedMockStorage) UploadPart( return s3types.CompletedPart{ ChecksumCRC32: &digest, ChecksumCRC32C: &layerKey, - PartNumber: int32(partNumber), + PartNumber: aws.Int32(int32(partNumber)), }, nil } diff --git a/dfs/storj/storj.go b/dfs/storj/storj.go index c06eb0e2..22411ffc 100644 --- a/dfs/storj/storj.go +++ b/dfs/storj/storj.go @@ -73,9 +73,9 @@ func (sj *storj) UploadPart( Bucket: &sj.bucket, ChecksumAlgorithm: s3types.ChecksumAlgorithmSha256, ChecksumSHA256: aws.String(digest), - ContentLength: contentLength, + ContentLength: &contentLength, Key: &layerKey, - PartNumber: int32(partNumber), + PartNumber: aws.Int32(int32(partNumber)), UploadId: &uploadId, } @@ -87,7 +87,7 @@ func (sj *storj) UploadPart( return s3types.CompletedPart{ ChecksumSHA256: &digest, ETag: resp.ETag, - PartNumber: int32(partNumber), + PartNumber: aws.Int32(int32(partNumber)), }, nil } @@ -142,7 +142,7 @@ func (sj *storj) Upload(ctx context.Context, identifier, digest string, content Body: bytes.NewBuffer(content), ChecksumAlgorithm: s3types.ChecksumAlgorithmSha256, ChecksumSHA256: &digest, - ContentLength: int64(len(content)), + ContentLength: aws.Int64(int64(len(content))), StorageClass: s3types.StorageClassStandard, } if sj.env == config.CI { @@ -225,7 +225,7 @@ func (sj *storj) Metadata(identifier string) (*types.ObjectMetadata, error) { ContentType: *resp.ContentType, Etag: *resp.ETag, DFSLink: identifier, - ContentLength: int(resp.ContentLength), + ContentLength: int(*resp.ContentLength), }, nil } @@ -241,7 +241,7 @@ func (sj *storj) GetUploadProgress(identifier, uploadID string) (*types.ObjectMe var uploadedSize int64 for _, p := range partsResp.Parts { - uploadedSize += p.Size + uploadedSize += *p.Size } return &types.ObjectMetadata{ diff --git a/dfs/storj/uplink/uplink.go b/dfs/storj/uplink/uplink.go index 464e9d68..39cd2dec 100644 --- a/dfs/storj/uplink/uplink.go +++ b/dfs/storj/uplink/uplink.go @@ -7,6 +7,7 @@ import ( "log" "time" + "github.com/aws/aws-sdk-go-v2/aws" s3types "github.com/aws/aws-sdk-go-v2/service/s3/types" "github.com/containerish/OpenRegistry/config" "github.com/containerish/OpenRegistry/dfs" @@ -100,7 +101,7 @@ func (u *storjUplink) UploadPart( return s3types.CompletedPart{ ETag: &digest, - PartNumber: int32(partNumber), + PartNumber: aws.Int32(int32(partNumber)), }, nil }