fix(monitor): disk observations follow the disk, and OCI containers keep their address

- The observations of a disk belong to its serial number, not to its
  connector: a replaced disk starts clean, and the badge of the list
  counts what the detail of the disk lists.
- An OCI container is recognised while it is still being installed, so
  an image that carries Docker inside is not offered Docker.
- Links use the IPv4 address of a container and write IPv6 in brackets;
  an answer without an address of its own is read again.
- The Monitor restores, when it starts, the DHCP clients of containers
  that were started from it.
This commit is contained in:
MacRimi
2026-10-08 17:14:36 +02:00
parent f5ad4072b5
commit 053b6c81f8
7 changed files with 318 additions and 131 deletions
+8 -2
View File
@@ -36,10 +36,10 @@ class CatalogFixture(unittest.TestCase):
item.start()
self.addCleanup(item.stop)
def install(self, endpoints, template_id='image-frigate'):
def install(self, endpoints, template_id='image-frigate', status='installed'):
(self.root / 'instances/190').mkdir(parents=True)
(self.root / 'instances/190/oci-compose.json').write_text(json.dumps({
'vmid': 190, 'status': 'installed', 'installation_id': 'install-190',
'vmid': 190, 'status': status, 'installation_id': 'install-190',
'observed': {'image': {'manifest_digest': 'sha256:' + 'b1' * 32, 'architecture': 'amd64'}},
'template': {'id': template_id, 'catalog_ui': {'title': 'Frigate'},
'first_run': {'endpoints': endpoints},
@@ -58,6 +58,12 @@ class OciEndpointTests(CatalogFixture):
])
self.assertEqual(meta['endpoint_port'], 5000)
def test_the_record_names_the_container_while_it_is_being_installed(self):
self.assertEqual(self.install(ENDPOINTS, status='installing')['template_id'], 'image-frigate')
def test_a_failed_installation_names_nothing(self):
self.assertIsNone(self.install(ENDPOINTS, status='failed'))
def test_single_endpoint_and_unknown_template(self):
meta = self.install([ENDPOINTS[0]], template_id='image-other')
self.assertEqual(meta['endpoints'], [