From 679f72fb6d32f888bbbf9c499ccdca0708e15c12 Mon Sep 17 00:00:00 2001 From: Adam Dyess Date: Fri, 17 May 2024 11:40:15 +0200 Subject: [PATCH] Prefer the cluster relation for bootstrap address rather than juju-info (#116) * Prefer the cluster relation for bootstrap address rather than juju-info * Address test failures --- charms/worker/k8s/src/charm.py | 2 +- tests/integration/conftest.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/charms/worker/k8s/src/charm.py b/charms/worker/k8s/src/charm.py index 4a119bab..1f7fa628 100755 --- a/charms/worker/k8s/src/charm.py +++ b/charms/worker/k8s/src/charm.py @@ -286,7 +286,7 @@ def _bootstrap_k8s_snap(self): status.add(ops.MaintenanceStatus("Bootstrapping Cluster")) - binding = self.model.get_binding("juju-info") + binding = self.model.get_binding("cluster") address = binding and binding.network.ingress_address node_name = self.get_node_name() payload = CreateClusterRequest( diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 7d3f7452..a9f6c502 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -243,7 +243,10 @@ async def deploy_model( status="active", timeout=30 * 60, ) - yield the_model + try: + yield the_model + except GeneratorExit: + log.fatal("Failed to determine model: model_name=%s", model_name) @pytest_asyncio.fixture(scope="module")