Require region in BSL validation when s3Url is set#2109
Require region in BSL validation when s3Url is set#2109kaovilai wants to merge 1 commit intoopenshift:oadp-devfrom
Conversation
When a custom s3Url is configured, the BSL points to a non-AWS S3-compatible service (e.g. IBM Cloud Object Storage, MinIO) where region auto-discovery via AWS HeadBucket API is not valid. Previously, region was only enforced when s3ForcePathStyle was true or AWS discovery failed. This allowed validation to pass with a missing region if a same-named bucket happened to exist on AWS, causing Velero to fail at runtime. Fixes: openshift#2108 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (2)
WalkthroughThe changes add validation to require explicit region configuration when a custom S3URL is set in AWS BackupStorageLocation specs. Three test cases are added to verify the validation behavior for S3URL configurations with and without regions. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kaovilai The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR enhances BSL (BackupStorageLocation) validation to require an explicit region parameter when a custom s3Url is configured for AWS-provider BSLs. This prevents scenarios where the operator incorrectly attempts AWS region auto-discovery for non-AWS S3-compatible services (e.g., IBM Cloud Object Storage, MinIO), which can lead to validation passing with incorrect configuration but Velero failing at runtime.
Changes:
- Added validation logic to require
regionwhens3Urlis set in AWS BSL configuration - Updated error message to be more direct ("is required" vs "not automatically discoverable")
- Added comprehensive test cases for the new validation rule
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/controller/bsl.go | Added check for s3Url in region validation logic and updated error message |
| internal/controller/bsl_test.go | Added three test cases covering s3Url with/without region and combination with s3ForcePathStyle |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/retest |
|
@kaovilai: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
When a custom s3Url is configured, the BSL points to a non-AWS
S3-compatible service (e.g. IBM Cloud Object Storage, MinIO) where
region auto-discovery via AWS HeadBucket API is not valid. Previously,
region was only enforced when s3ForcePathStyle was true or AWS
discovery failed. This allowed validation to pass with a missing
region if a same-named bucket happened to exist on AWS, causing
Velero to fail at runtime.
Fixes: #2108
Generated with Claude Code
via Happy
Co-Authored-By: Claude noreply@anthropic.com
Co-Authored-By: Happy yesreply@happy.engineering
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Why the changes were made
How to test the changes made
Summary by CodeRabbit