Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
louisruch committed Nov 14, 2024
1 parent 6f11321 commit c349439
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions plugin/service/storage/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func (p *StoragePlugin) HeadObject(ctx context.Context, req *pb.HeadObjectReques
return nil, parseS3Error("head object", err, req).Err()
}
return &pb.HeadObjectResponse{
ContentLength: resp.ContentLength,
ContentLength: aws.ToInt64(resp.ContentLength),
LastModified: timestamppb.New(*resp.LastModified),
}, nil
}
Expand Down Expand Up @@ -712,13 +712,13 @@ func (p *StoragePlugin) DeleteObjects(ctx context.Context, req *pb.DeleteObjects
res, err := client.ListObjectsV2(ctx, &s3.ListObjectsV2Input{
Bucket: aws.String(bucket.GetBucketName()),
Prefix: aws.String(prefix),
MaxKeys: maxkeys,
MaxKeys: aws.Int32(maxkeys),
ContinuationToken: conToken,
})
if err != nil {
return nil, parseS3Error("list objects", err, req).Err()
}
truncated = res.IsTruncated
truncated = aws.ToBool(res.IsTruncated)
conToken = res.NextContinuationToken
for _, o := range res.Contents {
objects = append(objects, types.ObjectIdentifier{
Expand Down
12 changes: 6 additions & 6 deletions plugin/service/storage/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2241,7 +2241,7 @@ func TestStoragePlugin_HeadObject(t *testing.T) {
newTestMockS3(
nil,
testMockS3WithHeadObjectOutput(&s3.HeadObjectOutput{
ContentLength: 1024,
ContentLength: aws.Int64(1024),
LastModified: aws.Time(createTime(t, "2006-01-02T15:04:05Z")),
}),
),
Expand Down Expand Up @@ -2272,7 +2272,7 @@ func TestStoragePlugin_HeadObject(t *testing.T) {
newTestMockS3(
nil,
testMockS3WithHeadObjectOutput(&s3.HeadObjectOutput{
ContentLength: 1024,
ContentLength: aws.Int64(1024),
LastModified: aws.Time(createTime(t, "2006-01-02T15:04:05Z")),
}),
),
Expand Down Expand Up @@ -3685,7 +3685,7 @@ func TestStoragePlugin_DeleteObjects(t *testing.T) {
newTestMockS3(
nil,
testMockS3WithListObjectsV2Output(&s3.ListObjectsV2Output{
IsTruncated: false,
IsTruncated: aws.Bool(false),
Contents: []s3types.Object{
{
Key: aws.String("abc/abc"),
Expand Down Expand Up @@ -3763,7 +3763,7 @@ func TestStoragePlugin_DeleteObjects(t *testing.T) {
newTestMockS3(
nil,
testMockS3WithListObjectsV2Output(&s3.ListObjectsV2Output{
IsTruncated: false,
IsTruncated: aws.Bool(false),
Contents: []s3types.Object{
s3types.Object{
Key: aws.String("abc/abc"),
Expand Down Expand Up @@ -3808,7 +3808,7 @@ func TestStoragePlugin_DeleteObjects(t *testing.T) {
newTestMockS3(
nil,
testMockS3WithListObjectsV2Output(&s3.ListObjectsV2Output{
IsTruncated: false,
IsTruncated: aws.Bool(false),
Contents: []s3types.Object{
{Key: aws.String("abc/abc1")},
{Key: aws.String("abc/abc2")},
Expand Down Expand Up @@ -3836,7 +3836,7 @@ func TestStoragePlugin_DeleteObjects(t *testing.T) {
newTestMockS3(
nil,
testMockS3WithListObjectsV2Output(&s3.ListObjectsV2Output{
IsTruncated: false,
IsTruncated: aws.Bool(false),
Contents: []s3types.Object{},
}),
// no deleted response since it shouldn't be called
Expand Down

0 comments on commit c349439

Please sign in to comment.