mc
mc copied to clipboard
Disabling a lifecycle rule removed prefix
Given a ILM rule:
{
"Expiration": {
"Days": 60
},
"ID": "Rule",
"Filter": { "Prefix": "prefix/" },
"Status": "Enabled"
}
Expected behavior
When using mc ilm edit myminio/test --id "Rule" --disable
I'd expect the rule to be disabled with a way to enable it again easily. I'd expect only the enabled flag being rewritten to "Disabled" and also having an option "--enable" that reverts that back to the "Enabled" state.
Actual behavior
At the moment when executing this command the rule gets disabled with no obvious way to renable it and at the same time also the Prefix that has been set gets removed from that rule while the Days are kept. ilm ls
shows no prefix anymore and export has no prefix set:
Export:
{
"AbortIncompleteMultipartUpload": {},
"Expiration": {
"Date": "0001-01-01T00:00:00Z",
"Days": 60,
"DeleteMarker": false
},
"ID": "Rule",
"Filter": { "And": {}, "Tag": {} },
"NoncurrentVersionExpiration": { "NoncurrentDays": 0 },
"NoncurrentVersionTransition": {},
"Status": "Disabled",
"Transition": { "Date": "0001-01-01T00:00:00Z" }
}
Steps to reproduce the behavior
mc --version
- mc version RELEASE.2021-03-23T05-46-11Z
- minio server RELEASE.2021-03-26T00-00-41Z
System information
Docker
@WolfspiritM mc ilm edit myminio/test --id "Rule" --disable
The prefix is calculated from 'minio/test' which is empty in the case.
I would prefer --prefix flag instead of that and we can add it without breaking existing behavior but the team needs to discuss this.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.
I would prefer --prefix flag instead of that and we can add it without breaking existing behavior but the team needs to discuss this.
@vadmeste what is pending here?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.
I will fix it and deprecate the old style without --prefix
Fixed with https://github.com/minio/mc/pull/4209