Skip to content

Commit c349439

Browse files
committed
fix errors
1 parent 6f11321 commit c349439

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

plugin/service/storage/plugin.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ func (p *StoragePlugin) HeadObject(ctx context.Context, req *pb.HeadObjectReques
360360
return nil, parseS3Error("head object", err, req).Err()
361361
}
362362
return &pb.HeadObjectResponse{
363-
ContentLength: resp.ContentLength,
363+
ContentLength: aws.ToInt64(resp.ContentLength),
364364
LastModified: timestamppb.New(*resp.LastModified),
365365
}, nil
366366
}
@@ -712,13 +712,13 @@ func (p *StoragePlugin) DeleteObjects(ctx context.Context, req *pb.DeleteObjects
712712
res, err := client.ListObjectsV2(ctx, &s3.ListObjectsV2Input{
713713
Bucket: aws.String(bucket.GetBucketName()),
714714
Prefix: aws.String(prefix),
715-
MaxKeys: maxkeys,
715+
MaxKeys: aws.Int32(maxkeys),
716716
ContinuationToken: conToken,
717717
})
718718
if err != nil {
719719
return nil, parseS3Error("list objects", err, req).Err()
720720
}
721-
truncated = res.IsTruncated
721+
truncated = aws.ToBool(res.IsTruncated)
722722
conToken = res.NextContinuationToken
723723
for _, o := range res.Contents {
724724
objects = append(objects, types.ObjectIdentifier{

plugin/service/storage/plugin_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -2241,7 +2241,7 @@ func TestStoragePlugin_HeadObject(t *testing.T) {
22412241
newTestMockS3(
22422242
nil,
22432243
testMockS3WithHeadObjectOutput(&s3.HeadObjectOutput{
2244-
ContentLength: 1024,
2244+
ContentLength: aws.Int64(1024),
22452245
LastModified: aws.Time(createTime(t, "2006-01-02T15:04:05Z")),
22462246
}),
22472247
),
@@ -2272,7 +2272,7 @@ func TestStoragePlugin_HeadObject(t *testing.T) {
22722272
newTestMockS3(
22732273
nil,
22742274
testMockS3WithHeadObjectOutput(&s3.HeadObjectOutput{
2275-
ContentLength: 1024,
2275+
ContentLength: aws.Int64(1024),
22762276
LastModified: aws.Time(createTime(t, "2006-01-02T15:04:05Z")),
22772277
}),
22782278
),
@@ -3685,7 +3685,7 @@ func TestStoragePlugin_DeleteObjects(t *testing.T) {
36853685
newTestMockS3(
36863686
nil,
36873687
testMockS3WithListObjectsV2Output(&s3.ListObjectsV2Output{
3688-
IsTruncated: false,
3688+
IsTruncated: aws.Bool(false),
36893689
Contents: []s3types.Object{
36903690
{
36913691
Key: aws.String("abc/abc"),
@@ -3763,7 +3763,7 @@ func TestStoragePlugin_DeleteObjects(t *testing.T) {
37633763
newTestMockS3(
37643764
nil,
37653765
testMockS3WithListObjectsV2Output(&s3.ListObjectsV2Output{
3766-
IsTruncated: false,
3766+
IsTruncated: aws.Bool(false),
37673767
Contents: []s3types.Object{
37683768
s3types.Object{
37693769
Key: aws.String("abc/abc"),
@@ -3808,7 +3808,7 @@ func TestStoragePlugin_DeleteObjects(t *testing.T) {
38083808
newTestMockS3(
38093809
nil,
38103810
testMockS3WithListObjectsV2Output(&s3.ListObjectsV2Output{
3811-
IsTruncated: false,
3811+
IsTruncated: aws.Bool(false),
38123812
Contents: []s3types.Object{
38133813
{Key: aws.String("abc/abc1")},
38143814
{Key: aws.String("abc/abc2")},
@@ -3836,7 +3836,7 @@ func TestStoragePlugin_DeleteObjects(t *testing.T) {
38363836
newTestMockS3(
38373837
nil,
38383838
testMockS3WithListObjectsV2Output(&s3.ListObjectsV2Output{
3839-
IsTruncated: false,
3839+
IsTruncated: aws.Bool(false),
38403840
Contents: []s3types.Object{},
38413841
}),
38423842
// no deleted response since it shouldn't be called

0 commit comments

Comments
 (0)