Skip to content

Commit 921a26b

Browse files
authored
Ignore UnsupportedArgument error for GetBucketAccelerateConfiguration in GovCloud regions (#85)
This PR resolves [issue 1407](aws-controllers-k8s/community#1407) related to S3 accelerate error handling in govcloud accounts. Co-authored-by: Mike Lumetta <[email protected]> Co-authored-by: Giang Nguyen <[email protected]> Co-authored-by: Manali Bhatt <[email protected]> Issue #, if available: 1407 Description of changes: This PR adds a check for the AWS error code `UnsupportedArgument` in `addPutFieldsToSpec` in pkg/resource/bucket/hook.go and uses the default transfer accelerate configuration for the spec if that error is returned. The `UnsupportedArgument` error is not documented by the S3 docs but is returned by the S3 API in GovCloud regions for us and other GovCloud users, as we documented in [this comment](aws-controllers-k8s/community#1407 (comment)). By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 9313026 commit 921a26b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/resource/bucket/hook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ func (rm *resourceManager) addPutFieldsToSpec(
299299
// This method is not supported in every region, ignore any errors if
300300
// we attempt to describe this property in a region in which it's not
301301
// supported.
302-
if awsErr, ok := ackerr.AWSError(err); ok && awsErr.Code() == "MethodNotAllowed" {
302+
if awsErr, ok := ackerr.AWSError(err); ok && (awsErr.Code() == "MethodNotAllowed" || awsErr.Code() == "UnsupportedArgument") {
303303
getAccelerateResponse = &svcsdk.GetBucketAccelerateConfigurationOutput{}
304304
} else {
305305
return err

0 commit comments

Comments
 (0)