You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OADP-5777: Add automatic S3 bucket region detection and document AWS HeadBucket API behavior (#1740)
* Add tests for auto bucket region on priv/pubic bucket
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
* OADP-5777: Add automatic S3 bucket region detection for AWS BSLs
This commit adds automatic region detection for AWS S3 buckets in BackupStorageLocation
configurations when using actual AWS S3 (not S3-compatible storage).
Changes:
- Modified UpdateBackupStorageLocation in pkg/common/common.go to auto-detect
and set the region when:
* Provider is "aws"
* No custom s3Url is configured (meaning it's real AWS S3)
* No region is already specified in the config
* A bucket name is provided in ObjectStorage
- The implementation uses aws.GetBucketRegion() which AWS Security confirmed
works with anonymous credentials for both public and private buckets
(Engagement ID: CACenGS4Mha_KeJ=e3jBSLD6rPZ2iNtfuJUv9QJViaCOt7GVNDg)
- Added comprehensive test cases to verify:
* Region auto-detection is skipped when region is already specified
* Region auto-detection is skipped for S3-compatible storage (with s3Url)
* Region auto-detection works with real AWS bucket (tested with
openshift-velero-plugin-s3-auto-region-test-1)
Benefits:
- Prevents configuration errors from incorrect region specifications
- Reduces manual configuration requirements for AWS BSLs
- Works seamlessly with existing anonymous credential approach
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* OADP-5777: Fix E2E test to accept auto-detected region in BSL
Update DoesBSLSpecMatchesDpa function to accept that DPA spec can have
an empty region while the deployed BSL has an auto-detected region.
The test now properly handles the scenario where:
- DPA spec doesn't specify a region
- No custom s3Url is configured (real AWS S3)
- The deployed BSL has an auto-detected region
This ensures the E2E test "DPA CR without Region, without S3ForcePathStyle
and with BackupImages false" passes with the new auto-detection feature.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
config.WithRegion("us-east-1"), // This is not default region being used, this is to specify a region hinting server that we will use to get region from.
0 commit comments