Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.
This repository was archived by the owner on May 30, 2025. It is now read-only.

Unable to set Bucket lifecycle rule condition ageInDays to 0  #515

Description

@fbozic

What happened?

I've created a GCP Storage Bucket with this provider. When I tried to add a lifecycle rule that should delete objects older than 0 days, provider reports following error: message: 'update failed: cannot update GCP bucket: googleapi: Error 400: Invalid argument., invalid'

I'm able to create this lifecycle rule from the GCP console, image as proof:
Screenshot 2023-10-31 at 21 02 39

How can we reproduce it?

Apply the example of Bucket attached below and wait for Bucket to be created. Uncomment the lifecycle config, apply Bucket again, and observe the error reported above.

apiVersion: storage.gcp.crossplane.io/v1alpha3
kind: Bucket
metadata:
  name: fb-test-bucket-lifecycle-123
spec:
  deletionPolicy: Delete
  # lifecycle:
  #   rules:
  #   - action:
  #       type: Delete
  #     condition:
  #       ageInDays: 0
  location: europe-west3
  providerConfigRef:
    name: default
  storageClass: REGIONAL

What environment did it happen in?

Crossplane version: v1.10.1
Kubernetes version: v1.26.5-gke.2100
Kubernetes distribution: GKE
Provider GCP version: v0.21.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions