Skip to content

Commit

Permalink
CopyObjectPart: Add x-amz-copy-source-if-match as condition (#1078)
Browse files Browse the repository at this point in the history
This adds source etag match condition in copy object part, this
change is obvious but also tests a use case in Minio server in
different copy configuration.
  • Loading branch information
vadmeste authored and kannappanr committed Mar 12, 2019
1 parent b329768 commit 5df2287
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions functional_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -6627,6 +6627,9 @@ func testSSECEncryptedToSSECCopyObjectPart() {
for k, v := range header {
metadata[k] = v[0]
}

metadata["x-amz-copy-source-if-match"] = objInfo.ETag

// First of three parts
fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
if err != nil {
Expand Down Expand Up @@ -6774,6 +6777,9 @@ func testSSECEncryptedToUnencryptedCopyPart() {
for k, v := range header {
metadata[k] = v[0]
}

metadata["x-amz-copy-source-if-match"] = objInfo.ETag

// First of three parts
fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
if err != nil {
Expand Down Expand Up @@ -6923,6 +6929,9 @@ func testSSECEncryptedToSSES3CopyObjectPart() {
for k, v := range header {
metadata[k] = v[0]
}

metadata["x-amz-copy-source-if-match"] = objInfo.ETag

// First of three parts
fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
if err != nil {
Expand Down Expand Up @@ -7069,6 +7078,9 @@ func testUnencryptedToSSECCopyObjectPart() {
for k, v := range header {
metadata[k] = v[0]
}

metadata["x-amz-copy-source-if-match"] = objInfo.ETag

// First of three parts
fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
if err != nil {
Expand Down Expand Up @@ -7212,6 +7224,9 @@ func testUnencryptedToUnencryptedCopyPart() {
for k, v := range header {
metadata[k] = v[0]
}

metadata["x-amz-copy-source-if-match"] = objInfo.ETag

// First of three parts
fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
if err != nil {
Expand Down Expand Up @@ -7358,6 +7373,9 @@ func testUnencryptedToSSES3CopyObjectPart() {
for k, v := range header {
metadata[k] = v[0]
}

metadata["x-amz-copy-source-if-match"] = objInfo.ETag

// First of three parts
fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
if err != nil {
Expand Down Expand Up @@ -7504,6 +7522,9 @@ func testSSES3EncryptedToSSECCopyObjectPart() {
for k, v := range header {
metadata[k] = v[0]
}

metadata["x-amz-copy-source-if-match"] = objInfo.ETag

// First of three parts
fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
if err != nil {
Expand Down Expand Up @@ -7648,6 +7669,9 @@ func testSSES3EncryptedToUnencryptedCopyPart() {
for k, v := range header {
metadata[k] = v[0]
}

metadata["x-amz-copy-source-if-match"] = objInfo.ETag

// First of three parts
fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
if err != nil {
Expand Down Expand Up @@ -7795,6 +7819,9 @@ func testSSES3EncryptedToSSES3CopyObjectPart() {
for k, v := range header {
metadata[k] = v[0]
}

metadata["x-amz-copy-source-if-match"] = objInfo.ETag

// First of three parts
fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
if err != nil {
Expand Down

0 comments on commit 5df2287

Please sign in to comment.