Skip to content

Commit

Permalink
use is_minio for endpoint too
Browse files Browse the repository at this point in the history
  • Loading branch information
maskarb committed Jan 23, 2025
1 parent 52b6d41 commit 32ece9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions koku/koku/configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ def get_cloudwatch_log_group():
"""Obtain cloudwatch log group."""
pass

def get_object_store_endpoint_default(self):
pass

@staticmethod
def get_object_store_endpoint():
"""Obtain object store endpoint."""
Expand Down Expand Up @@ -263,6 +266,9 @@ def get_cloudwatch_log_group():
"""Obtain cloudwatch log group."""
return ENVIRONMENT.get_value("CW_LOG_GROUP", default="platform-dev")

def get_object_store_endpoint_default(self):
return self.get_object_store_endpoint()

@staticmethod
def get_object_store_endpoint():
"""Obtain object store endpoint."""
Expand Down Expand Up @@ -458,6 +464,11 @@ def get_cloudwatch_log_group():
"""Obtain cloudwatch log group."""
return LoadedConfig.logging.cloudwatch.logGroup

def get_object_store_endpoint_default(self):
if self.is_minio:
return self.get_object_store_endpoint()
return ENVIRONMENT.get_value("S3_ENDPOINT", default="https://s3.amazonaws.com")

@staticmethod
def get_object_store_endpoint():
"""Obtain object store endpoint."""
Expand Down
2 changes: 1 addition & 1 deletion koku/koku/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@
REQUESTED_ROS_BUCKET = ENVIRONMENT.get_value("REQUESTED_ROS_BUCKET", default="ros-report")
REQUESTED_SUBS_BUCKET = ENVIRONMENT.get_value("REQUESTED_SUBS_BUCKET", default="subs-report")
S3_TIMEOUT = ENVIRONMENT.int("S3_CONNECTION_TIMEOUT", default=60)
S3_ENDPOINT = ENVIRONMENT.get_value("S3_ENDPOINT", default="https://s3.amazonaws.com")
S3_ENDPOINT = CONFIGURATOR.get_object_store_endpoint_default()
S3_REGION = ENVIRONMENT.get_value("S3_REGION", default="us-east-1")
S3_BUCKET_NAME = CONFIGURATOR.get_object_store_bucket(REQUESTED_BUCKET)
S3_ACCESS_KEY = CONFIGURATOR.get_object_store_access_key_default(REQUESTED_BUCKET)
Expand Down

0 comments on commit 32ece9c

Please sign in to comment.