Skip to content

Commit

Permalink
Merge pull request #2154 from open-dynaMIX/fix_minio_healthz_check
Browse files Browse the repository at this point in the history
fix: do not query for non-existent buckets in healthz
  • Loading branch information
winged authored Feb 8, 2024
2 parents adc3ff1 + 6b81a0c commit dfeaa09
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v10.1.1 (8 February 2024)
### Fix

* Do not query for non-existent buckets in healthz ([`7d5e8ab`](https://github.com/projectcaluma/caluma/commit/7d5e8ab0d2188ee10f9b304737c5835ccb0d0e49))


# v10.1.0 (8 February 2024)

### Feature
Expand Down
2 changes: 1 addition & 1 deletion caluma/caluma_core/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def db_broken_connection(transactional_db):
def minio_mock_working(mocker):
"""Provide working minio mock for health checks."""
return mocker.patch.object(
storage_clients.client.client, "bucket_exists", return_value=False
storage_clients.client.client, "bucket_exists", return_value=True
)


Expand Down
8 changes: 5 additions & 3 deletions caluma/caluma_core/health_checks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from io import StringIO
from uuid import uuid4

from django.conf import settings
from django.core import management
Expand Down Expand Up @@ -28,8 +27,11 @@ def _check_pending_migrations(db_name):
@check
def _check_media_storage_service():
"""Check media storage service connectivity."""
assert not storage_clients.client.client.bucket_exists(str(uuid4()))
return {"ok": True}
return {
"ok": storage_clients.client.client.bucket_exists(
settings.MINIO_STORAGE_MEDIA_BUCKET_NAME
)
}


def check_media_storage_service():
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "caluma"
version = "10.1.0"
version = "10.1.1"
description = "Caluma Service providing GraphQL API"
homepage = "https://caluma.io"
repository = "https://github.com/projectcaluma/caluma"
Expand Down

0 comments on commit dfeaa09

Please sign in to comment.