Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-10645. Support x-amz-metadata-directive in CopyObject #6490

Merged
merged 4 commits into from
Apr 10, 2024

Conversation

ivandika3
Copy link
Contributor

What changes were proposed in this pull request?

Need to support x-amz-metadata-directive: specifies whether the metadata is copied from the source object or replaced with metadata that's provided in the request. When copying an object, you can preserve all metadata (the default) or specify new metadata. If this header isn’t specified, COPY is the default behavior.

Valid Values: COPY | REPLACE

See: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html#API_CopyObject_RequestSyntax

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-10645

How was this patch tested?

Unit test and acceptance test.

Clean CI run: https://github.com/ivandika3/ozone/actions/runs/8589734492

@ivandika3
Copy link
Contributor Author

@kerneltime @DaveTeng0 @SaketaChalamchala @vtutrinov Could you help take a look when you have time?

@adoroszlai adoroszlai added the s3 S3 Gateway label Apr 8, 2024
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ivandika3 for the patch.

} else {
OS3Exception ex = newError(INVALID_ARGUMENT, metadataCopyDirective);
ex.setErrorMessage("An error occurred (InvalidArgument) " +
"when calling the CopyObjet operation: " +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"when calling the CopyObjet operation: " +
"when calling the CopyObject operation: " +

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for catching it. Updated.

OS3Exception ex = newError(INVALID_ARGUMENT, metadataCopyDirective);
ex.setErrorMessage("An error occurred (InvalidArgument) " +
"when calling the CopyObjet operation: " +
"The metadata directive specified is invalid. The valid values are COPY or REPLACE.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"The metadata directive specified is invalid. The valid values are COPY or REPLACE.");
"The metadata directive specified is invalid. Valid values are COPY or REPLACE.");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ivandika3 for updating the patch, LGTM. I'll wait some time for another review.

Copy link
Contributor

@tanvipenumudy tanvipenumudy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ivandika3 for the patch, the changes look good.

@adoroszlai adoroszlai merged commit e81f5c0 into apache:master Apr 10, 2024
39 checks passed
@adoroszlai
Copy link
Contributor

Thanks @ivandika3 for the patch, @tanvipenumudy for the review.

@ivandika3
Copy link
Contributor Author

Thank you for the reviews @adoroszlai @tanvipenumudy

Tejaskriya pushed a commit to Tejaskriya/ozone that referenced this pull request Apr 17, 2024
@ivandika3 ivandika3 self-assigned this Apr 23, 2024
ivandika3 added a commit to ivandika3/ozone that referenced this pull request May 6, 2024
ivandika3 added a commit to ivandika3/ozone that referenced this pull request May 7, 2024
jojochuang pushed a commit to jojochuang/ozone that referenced this pull request May 29, 2024
ivandika3 added a commit to ivandika3/ozone that referenced this pull request Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s3 S3 Gateway
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants