diff --git a/oci/catalog/apps/uptimekuma.json b/oci/catalog/apps/uptimekuma.json index ea5cad0d..0ab13ac1 100644 --- a/oci/catalog/apps/uptimekuma.json +++ b/oci/catalog/apps/uptimekuma.json @@ -50,10 +50,10 @@ "service_name": "uptimekuma", "container_name": "uptimekuma", "image": { - "reference": "louislam/uptime-kuma:latest", + "reference": "louislam/uptime-kuma:2", "registry": "docker.io", "repository": "louislam/uptime-kuma", - "tag": "latest", + "tag": "2", "digest": null, "pull_policy": "resolve-selected-tag-to-architecture-digest-at-install" }, @@ -88,7 +88,7 @@ "related_services": [], "restart": "unless-stopped", "stop_grace_period": null, - "original_compose": "name: uptimekuma\nservices:\n uptimekuma:\n image: louislam/uptime-kuma:latest\n deploy:\n resources:\n reservations:\n memory: 128M\n network_mode: bridge\n ports:\n - target: 3001\n published: '3001'\n protocol: tcp\n restart: unless-stopped\n volumes:\n - type: bind\n source: /DATA/AppData/$AppID/app/data\n target: /app/data\n container_name: uptimekuma\n" + "original_compose": "name: uptimekuma\nservices:\n uptimekuma:\n image: louislam/uptime-kuma:2\n deploy:\n resources:\n reservations:\n memory: 128M\n network_mode: bridge\n ports:\n - target: 3001\n published: '3001'\n protocol: tcp\n restart: unless-stopped\n volumes:\n - type: bind\n source: /DATA/AppData/$AppID/app/data\n target: /app/data\n container_name: uptimekuma\n" }, "compose_stack": { "project_name": "uptimekuma", @@ -99,7 +99,7 @@ "services": [ { "name": "uptimekuma", - "image": "louislam/uptime-kuma:latest", + "image": "louislam/uptime-kuma:2", "is_main": true, "role": "frontend", "vmid_offset": 0, @@ -107,7 +107,7 @@ "frontend_network": true, "private_network": false, "compose": { - "image": "louislam/uptime-kuma:latest", + "image": "louislam/uptime-kuma:2", "deploy": { "resources": { "reservations": { diff --git a/oci/tests/test_uptimekuma_image_tag.py b/oci/tests/test_uptimekuma_image_tag.py new file mode 100644 index 00000000..b095b9dd --- /dev/null +++ b/oci/tests/test_uptimekuma_image_tag.py @@ -0,0 +1,37 @@ +"""Uptime Kuma must use the current v2 image line, not the frozen latest tag.""" + +import json +from pathlib import Path +import sys +import unittest + + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "src")) + +from proxmenux_oci.catalog import Catalog + + +class UptimeKumaImageTagTests(unittest.TestCase): + def test_catalog_and_composed_template_use_v2(self): + entry = json.loads((ROOT / "catalog" / "apps" / "uptimekuma.json").read_text()) + template = Catalog(ROOT).compose("uptimekuma") + + self.assertEqual( + entry["container_contract"]["image"]["reference"], + "louislam/uptime-kuma:2", + ) + self.assertEqual(entry["container_contract"]["image"]["tag"], "2") + self.assertNotIn("louislam/uptime-kuma:latest", entry["container_contract"]["original_compose"]) + + self.assertEqual( + template["container_contract"]["image"]["reference"], + "louislam/uptime-kuma:2", + ) + service = template["compose_stack"]["services"][0] + self.assertEqual(service["image"], "louislam/uptime-kuma:2") + self.assertEqual(service["compose"]["image"], "louislam/uptime-kuma:2") + + +if __name__ == "__main__": + unittest.main()