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

rgw: S3 lifecycle now supports expiration date #15807

Merged
merged 2 commits into from Jul 17, 2017

Conversation

Projects
None yet
4 participants
@zhangsw
Contributor

zhangsw commented Jun 21, 2017

Signed-off-by: Zhang Shaowen zhangshaowen@cmss.chinamobile.com

rgw: S3 lifecycle now supports expiration date
Signed-off-by: Zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
@zhangsw

This comment has been minimized.

Contributor

zhangsw commented Jun 21, 2017

The s3-test is here ceph/s3-tests#170

@cbodley cbodley added the rgw label Jun 21, 2017

@dang

Looks correct, but it could be simplified (and future-proofed) with the suggested change.

@@ -92,6 +96,19 @@ int RGWLifecycleConfiguration::check_and_add_rule(LCRule *rule)
return 0;
}
bool RGWLifecycleConfiguration::has_same_action(const lc_op& first, const lc_op& second) {
if ((first.expiration > 0 || first.expiration_date != boost::none) &&

This comment has been minimized.

@dang

dang Jun 26, 2017

Contributor

I think a better solution is to add an "empty()" or "valid()" method to LCExpiration that checks date and days. That way all the checks are simple for all the rule types. If "empty()" is used, then all the checks above can stay the same.

This also means that the code checking validity doesn't need to change when we add new types in the future.

This comment has been minimized.

@zhangsw

zhangsw Jul 7, 2017

Contributor

I've updated the pr as you advised

return date;
}
bool has_date() const {
return !date.empty();

This comment has been minimized.

@dang

dang Jun 26, 2017

Contributor

Should check for boost::none as well.

This comment has been minimized.

@zhangsw

zhangsw Jul 7, 2017

Contributor

date here is a string

rgw: add valid and empty in class LCExpiration.
Signed-off-by: Zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
@dang

dang approved these changes Jul 7, 2017

Looks good. Thanks!

@yuriw

This comment has been minimized.

@cbodley

This comment has been minimized.

Contributor

cbodley commented Jul 13, 2017

jenkins test this please

@yuriw yuriw merged commit eb26360 into ceph:master Jul 17, 2017

4 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details

@zhangsw zhangsw deleted the zhangsw:feature-lifecycle-date branch Aug 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment