Skip to content
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

Applying lifecycle tag rules don't show up in Console UI #3362

Closed
orientalperil opened this issue May 26, 2024 · 1 comment · Fixed by #3369
Closed

Applying lifecycle tag rules don't show up in Console UI #3362

orientalperil opened this issue May 26, 2024 · 1 comment · Fixed by #3369
Assignees
Labels
bug this needs to be fixed community

Comments

@orientalperil
Copy link

orientalperil commented May 26, 2024

NOTE

I'm trying to apply lifecycle rules to a bucket. The code works on S3 but not Minio.

Expected Behavior

Lifecycle rules should be applied to the bucket that include the tag filter.

Current Behavior

A rule is created but does not have the tag filter on it.

Steps to Reproduce (for bugs)

I used this code:

import boto3
from django.conf import settings

RETENTION = 'retention'
EXPIRE_FAST = 'expire_fast'

client = boto3.client(
    service_name='s3',
    aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
    aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
    endpoint_url=settings.AWS_S3_ENDPOINT_URL,  # http://127.0.0.1:6000
)


def s3_lifecycle_configuration():
    client.put_bucket_lifecycle_configuration(
        Bucket=settings.AWS_STORAGE_BUCKET_NAME,
        LifecycleConfiguration={
            'Rules': [
                {
                    'ID': 'Expire fast',
                    'Filter': {
                        'Tag': {
                            'Key': RETENTION,
                            'Value': EXPIRE_FAST,
                        },
                    },
                    'Status': 'Enabled',
                    'Expiration': {
                        'Days': 1,
                    },
                },
            ]
        }
    )

s3_lifecycle_configuration()

Context

I want to create a lifecycle rule that applies to files with certain tags.

Your Environment

  • Version used (minio --version): RELEASE.2024-05-10T01-41-38Z (go1.22.3 darwin/amd64)
  • Server setup and configuration: Python 3.10 with boto3
  • Operating System and version (uname -a): macOS 13.6

image

Interesting the export shows the rule as I expect. But in the web console you cannot see the filter.

$  ./mc ilm export myminio/my-bucket
{
 "Rules": [
  {
   "Expiration": {
    "Days": 1
   },
   "ID": "Expire fast",
   "Filter": {
    "Tag": {
     "Key": "retention",
     "Value": "expire_fast"
    }
   },
   "Status": "Enabled"
  }
 ]
}
@harshavardhana harshavardhana transferred this issue from minio/minio May 27, 2024
@harshavardhana harshavardhana changed the title Applying lifecycle rules with boto3 is not working Applying lifecycle tag rules don't show up in Console UI May 27, 2024
@minio minio deleted a comment from orientalperil May 27, 2024
@minio minio deleted a comment from orientalperil May 27, 2024
@minio minio deleted a comment from jiuker May 27, 2024
@minio minio deleted a comment from orientalperil May 27, 2024
@minio minio deleted a comment from orientalperil May 27, 2024
@orientalperil
Copy link
Author

Great thank you @harshavardhana

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug this needs to be fixed community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants