Bug #47167
closedrgw: lifecycle: Days can not be 0 for Expiration rules
0%
Description
Hi RGW team,
Nautilus 14.2.11.
I can apply next rule:
aws s3api get-bucket-lifecycle-configuration --bucket test-cc45ce9b-43c8-4e28-8a9a-a9d3ad0a2652
{
"Rules": [
{
"Status": "Enabled",
"Prefix": "",
"Expiration": {
"Days": 0
},
"ID": "remove old objects"
}
]
}
But in AWS s3:
aws s3api put-bucket-lifecycle-configuration --lifecycle-configuration file://~/ownCloud/ownCloud-tmp/s3-example/lc_by_days.json --bucket test-fatruden
An error occurred (InvalidArgument) when calling the PutBucketLifecycleConfiguration operation: 'Days' for Expiration action must be a positive integer
In Luminous 12.2.12 we couldn't apply this rule. Validation worked fine on Luminous.
I think it was changed in this issue: https://tracker.ceph.com/issues/38389
But it's not correct.
There are two type of lifecycle rules:
1. Expiration rules (removing objects)
2. Transition rules (moving objects to another storage class)
For Expiration rules AWS s3 doesn't allow Days=0, for Transition rules it's possible to specify Days=0.
You can read about it in https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-configuration-examples.html
And you can reproduce it with AWS S3 and awscli.
Updated by Or Friedmann over 3 years ago
- Status changed from New to Pending Backport
- Backport set to nautilus
- Pull request ID set to 30878
Updated by Nathan Cutler over 3 years ago
- Copied to Backport #47318: nautilus: rgw: lifecycle: Days can not be 0 for Expiration rules added
Updated by Nathan Cutler over 3 years ago
- Status changed from Pending Backport to Resolved
While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".