Skip to content

Add Bucket CORS configuration#391

Open
mariomalinditex wants to merge 2 commits into
linode:mainfrom
InditexTech:feat/bucket-cors-configuration
Open

Add Bucket CORS configuration#391
mariomalinditex wants to merge 2 commits into
linode:mainfrom
InditexTech:feat/bucket-cors-configuration

Conversation

@mariomalinditex

Copy link
Copy Markdown

Description of your changes

Add a CORSConfiguration sub-resource to the Bucket managed resource,
following the existing ServerSideEncryptionConfiguration pattern.

  • New CORSConfiguration/CORSRule API types and Bucket spec fields
    (corsConfiguration, corsConfigurationDisabled) plus the
    corsConfigurationCondition backend status.
  • S3-only implementation via Put/Get/DeleteBucketCors on the S3Client
    interface; no new external dependencies.
  • New CORSConfigurationClient sub-resource reconciler wired into the
    bucket controller, autopause checks and per-backend conditions.
  • --disable-cors-config-reconcile flag (DISABLE_CORS_CONFIG_RECONCILE).
  • Regenerated deepcopy, S3 client fakes and Bucket CRD; added example CR.

I have:

  • Run make ready-for-review to ensure this PR is ready for review.
  • Run make ceph-chainsaw to validate these changes against Ceph. This step is not always necessary. However, for changes related to S3 calls it is sensible to validate against an actual Ceph cluster. Localstack is used in our CI Chainsaw suite for convenience and there can be disparity in S3 behaviours between it and Ceph. See docs/TESTING.md for information on how to run tests against a Ceph cluster.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

  • Unit tests: Added tests for the CORS helpers (internal/rgw) and the CORSConfigurationClient reconcile flow (internal/controller/bucket) covering create/update, delete, drift, disabled, and unhealthy-backend paths. go test ./... passes.
  • Lint & codegen: golangci-lint passes with 0 issues; make generate regenerates the CRD, deepcopy, and S3 client fakes cleanly.
  • E2E (Chainsaw): Added CORS coverage (apply corsConfiguration + assert corsConfigurationCondition: Available) to the Localstack suite (e2e/tests/stable, runs in CI) and the Ceph suite (e2e/tests/ceph). Ran the Localstack suite locally against Kind.

Add a CORSConfiguration sub-resource to the Bucket managed resource,
following the existing ServerSideEncryptionConfiguration pattern.

- New CORSConfiguration/CORSRule API types and Bucket spec fields
  (corsConfiguration, corsConfigurationDisabled) plus the
  corsConfigurationCondition backend status.
- S3-only implementation via Put/Get/DeleteBucketCors on the S3Client
  interface; no new external dependencies.
- New CORSConfigurationClient sub-resource reconciler wired into the
  bucket controller, autopause checks and per-backend conditions.
- --disable-cors-config-reconcile flag (DISABLE_CORS_CONFIG_RECONCILE).
- Regenerated deepcopy, S3 client fakes and Bucket CRD; added example CR.

Signed-off-by: mariomalinditex <mariomal@ext.inditex.com>
Signed-off-by: mariomalinditex <mariomal@ext.inditex.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant