Skip to content

Commit

Permalink
Make opensearch protocol configurable (#661)
Browse files Browse the repository at this point in the history
Part of osism/issues#731

Signed-off-by: Christian Berendt <berendt@osism.tech>
  • Loading branch information
berendt authored Oct 30, 2023
1 parent d75d287 commit 1ff804a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion osism/commands/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def take_action(self, parsed_args):
break

result = requests.post(
f"https://{settings.OPENSEARCH_ADDRESS}:{settings.OPENSEARCH_PORT}/_plugins/_sql?format=json",
f"{settings.OPENSEARCH_PROTOCOL}://{settings.OPENSEARCH_ADDRESS}:{settings.OPENSEARCH_PORT}/_plugins/_sql?format=json",
data=json.dumps({"query": query}),
headers={"content-type": "application/json"},
verify=False,
Expand Down
1 change: 1 addition & 0 deletions osism/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def read_secret(secret_name):


OPENSEARCH_ADDRESS = os.getenv("OPENSEARCH_ADDRESS")
OPENSEARCH_PROTOCOL = os.getenv("OPENSEARCH_PROTOCOL", "https")
OPENSEARCH_PORT = os.getenv("OPENSEARCH_PORT")

REDIS_HOST: str = os.getenv("REDIS_HOST", "redis")
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/opensearch-protocol-c222c86a24ac594c.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
features:
- |
With the `OPENSEARCH_PROTOCOL` environment variable it is now possible
to configure the protocol (`http` or `https`) that should be used by
`osism log opensearch`.

0 comments on commit 1ff804a

Please sign in to comment.