mc icon indicating copy to clipboard operation
mc copied to clipboard

Disabling a lifecycle rule removed prefix

Open WolfspiritM opened this issue 3 years ago • 5 comments

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 avatar Mar 26 '21 23:03 WolfspiritM

@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.

vadmeste avatar Apr 28 '21 11:04 vadmeste

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.

stale[bot] avatar Jul 27 '21 18:07 stale[bot]

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.

stale[bot] avatar Oct 26 '21 03:10 stale[bot]

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?

harshavardhana avatar Jan 09 '22 05:01 harshavardhana

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.

stale[bot] avatar Apr 16 '22 02:04 stale[bot]

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.

stale[bot] avatar Aug 13 '22 02:08 stale[bot]

I will fix it and deprecate the old style without --prefix

vadmeste avatar Aug 14 '22 10:08 vadmeste

Fixed with https://github.com/minio/mc/pull/4209

vadmeste avatar Sep 07 '22 14:09 vadmeste