From ac5d5f676556f31a4d8811db26fc93b5ceae2a5f Mon Sep 17 00:00:00 2001 From: Yanks Yoon Date: Wed, 4 Sep 2024 03:46:36 +0000 Subject: [PATCH] fix: add image relation joined framework register --- src/charm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/charm.py b/src/charm.py index a61586b9b..ee1659933 100755 --- a/src/charm.py +++ b/src/charm.py @@ -246,6 +246,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.on[DEBUG_SSH_INTEGRATION_NAME].relation_changed, self._on_debug_ssh_relation_changed, ) + self.framework.observe( + self.on[IMAGE_INTEGRATION_NAME].relation_joined, + self._on_image_relation_joined, + ) self.framework.observe( self.on[IMAGE_INTEGRATION_NAME].relation_changed, self._on_image_relation_changed, @@ -1178,7 +1182,7 @@ def _on_image_relation_joined(self, _: ops.RelationJoinedEvent) -> None: cloud = list(clouds_yaml["clouds"].keys())[0] auth_map = clouds_yaml["clouds"][cloud]["auth"] for relation in self.model.relations[IMAGE_INTEGRATION_NAME]: - relation.data[self.model.unit].update(auth_map) + relation.data[self.unit].update(auth_map) @catch_charm_errors def _on_image_relation_changed(self, _: ops.RelationChangedEvent) -> None: