From a2d69765f7054186c3f40e3efaef29b6d595c3fd Mon Sep 17 00:00:00 2001 From: Adam Dyess Date: Thu, 23 May 2024 15:29:06 -0500 Subject: [PATCH] Prefer the cluster relation for bootstrap address rather than juju-info (#116) (#117) * 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 68feda01..abd249ab 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -266,7 +266,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")