Skip to content

Commit

Permalink
Use default region if LocationConstraint not found from s3 bucket
Browse files Browse the repository at this point in the history
Signed-off-by: Davanum Srinivas <[email protected]>
  • Loading branch information
dims committed Aug 1, 2024
1 parent 5162b75 commit af13170
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aws-janitor/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ func GetPath(cfg *aws2.Config, s string) (*Path, error) {
return nil, err
}

region := resp.LocationConstraint
region := regions.Default
if resp.LocationConstraint != "" {
region = string(resp.LocationConstraint)
}

return &Path{Region: string(region), Bucket: url.Host, Key: url.Path}, nil
}

0 comments on commit af13170

Please sign in to comment.