From 6ceb904c3ef529b13e6e9276977cff84be4a3b87 Mon Sep 17 00:00:00 2001 From: James Hewitt Date: Fri, 12 Aug 2022 16:04:52 +0100 Subject: [PATCH] Don't check returned storage class if we use NONE If we haven't set a storage class there's no point in checking the storage class applied to the object - s3 will choose one. Signed-off-by: James Hewitt --- registry/storage/driver/s3-aws/s3_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/registry/storage/driver/s3-aws/s3_test.go b/registry/storage/driver/s3-aws/s3_test.go index 487ba6520..cff8b1be9 100644 --- a/registry/storage/driver/s3-aws/s3_test.go +++ b/registry/storage/driver/s3-aws/s3_test.go @@ -229,7 +229,9 @@ func TestStorageClass(t *testing.T) { } defer resp.Body.Close() // Amazon only populates this header value for non-standard storage classes - if storageClass == s3.StorageClassStandard && resp.StorageClass != nil { + if storageClass == noStorageClass { + // We haven't specified a storage class so we can't confirm what it is + } else if storageClass == s3.StorageClassStandard && resp.StorageClass != nil { t.Fatalf( "unexpected response storage class for file with storage class %v: %v", storageClass,