From cb1b70e7fccbd3898819c6e1f722dc1880a4e632 Mon Sep 17 00:00:00 2001 From: Yanks Yoon <37652070+yanksyoon@users.noreply.github.com> Date: Thu, 5 Sep 2024 12:13:03 +0800 Subject: [PATCH] fix: add image relation joined framework register (#362) --- 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: