Skip to content

ACK S3 controller performs incorrect LifecycleConfigurationRule schema validationΒ #2626

@kblaszcz

Description

@kblaszcz

Description
ACK S3 controller doesn't require filter field or prefix field to exist in the manifest when creating LifecycleRule. AWS API doc assumes that either filter or prefix exists - See Filter description for more details here - https://docs.aws.amazon.com/AmazonS3/latest/API/API_LifecycleRule.html

Steps to reproduce

  1. Create following manifest file:
apiVersion: s3.services.k8s.aws/v1alpha1
kind: Bucket
metadata:
  name: test-random-name-bucket
spec:
  name: test-random-name-bucket
  lifecycle:
    rules:
      - id: NoncurrentVersion
        # filter:
        #   prefix: logs/
        status: Enabled
        noncurrentVersionTransitions:
          - noncurrentDays: 30
            storageClass: STANDARD_IA

  tagging:
    tagSet:
      - key: "Name"
        value: "test-random-name-bucket"
  1. Apply this manifest on your cluster with S3 controller installed
  2. See what happens:
    1. You will get bucket get 'created' response,
    2. bucket will be created without lifecycle rules,
    3. kubectl get buckets test-random-name-bucket -o yaml will show 'api error MalformedXML: The XML you provided was not well-formed or did not validate against our published schema'

Expected outcome
Should fail on schema validation and directly respond to user.

Environment

  • Kubernetes version: v1.33.4-eks-e386d34
  • Using EKS with Platform version eks.12
  • AWS service targeted - S3

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions