Skip to content

Commit

Permalink
rgw: DefaultRetention requires either Days or Years
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchang0812 committed Sep 16, 2019
1 parent 49addda commit a412849
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rgw/rgw_object_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ class RGWObjectLock
}

bool retention_period_valid() const {
return (get_years() > 0 || get_days() > 0);
// DefaultRetention requires either Days or Years.
// You can't specify both at the same time.
// see https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTObjectLockConfiguration.html
return get_years() > 0 != get_days() > 0;
}

bool has_rule() const {
Expand Down

0 comments on commit a412849

Please sign in to comment.