Skip to content

Commit

Permalink
fix: add image relation joined framework register
Browse files Browse the repository at this point in the history
  • Loading branch information
yanksyoon committed Sep 4, 2024
1 parent 01ff64d commit ac5d5f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ac5d5f6

Please sign in to comment.