Skip to content

Commit 6eade30

Browse files
authored
Fix creation of buckets in regions where acceleratation not allowed (#166)
Description of changes: There were a chnages which causes again an issues with accelerated setting for bucket. There need to check not only empty status but also a null getAccelerateResponse. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent bac1663 commit 6eade30

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/resource/bucket/hook.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,10 @@ func (rm *resourceManager) addPutFieldsToSpec(
323323
return err
324324
}
325325
}
326-
if getAccelerateResponse.Status != "" {
327-
ko.Spec.Accelerate = rm.setResourceAccelerate(r, getAccelerateResponse)
328-
} else {
326+
if getAccelerateResponse == nil || getAccelerateResponse.Status == "" {
329327
ko.Spec.Accelerate = nil
328+
} else {
329+
ko.Spec.Accelerate = rm.setResourceAccelerate(r, getAccelerateResponse)
330330
}
331331

332332
listAnalyticsResponse, err := rm.sdkapi.ListBucketAnalyticsConfigurations(ctx, rm.newListBucketAnalyticsPayload(r))

0 commit comments

Comments
 (0)