use S3 path style addressing when running in kubernetes (#1315)
This commit is contained in:
parent
aa6a0765c1
commit
cdb7305dac
@ -55,8 +55,10 @@ class ResponseObject(_TemplateEnvironmentMixin):
|
|||||||
if not host:
|
if not host:
|
||||||
host = urlparse(request.url).netloc
|
host = urlparse(request.url).netloc
|
||||||
|
|
||||||
if not host or host.startswith("localhost") or re.match(r"^[^.]+$", host):
|
if (not host or host.startswith('localhost') or
|
||||||
# For localhost or local domain names, default to path-based buckets
|
re.match(r'^[^.]+$', host) or re.match(r'^.*\.svc\.cluster\.local$', host)):
|
||||||
|
# Default to path-based buckets for (1) localhost, (2) local host names that do not
|
||||||
|
# contain a "." (e.g., Docker container host names), or (3) kubernetes host names
|
||||||
return False
|
return False
|
||||||
|
|
||||||
match = re.match(r'^([^\[\]:]+)(:\d+)?$', host)
|
match = re.match(r'^([^\[\]:]+)(:\d+)?$', host)
|
||||||
|
Loading…
Reference in New Issue
Block a user