Skip to content

Commit

Permalink
Add quoting in loki api call
Browse files Browse the repository at this point in the history
  • Loading branch information
totycro committed Dec 3, 2024
1 parent 9d2b0fb commit 6f4277d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pygeoapi_kubernetes_papermill/log_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_job_logs(process_id, job_id):
response = requests.get(
log_query_endpoint,
params={
"query": f"{{job={namespace}/{job_id}}}",
"query": f'{{job="{namespace}/{job_id}}}"',
},
)
response.raise_for_status()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_log_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def client():
def test_log_view_returns_log_lines(client, mock_loki_request):
job_id = "abc-123"

response = client.get(f"/processes/my-process/jobs/{job_id}/logs")
response = client.get(f"/jobs/{job_id}/logs")

assert mock_loki_request.mock_calls[0][2]["params"]["query"] == "{job=test/abc-123}"

Expand Down

0 comments on commit 6f4277d

Please sign in to comment.