Skip to content

Commit

Permalink
remove extra event handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
carlcsaposs-canonical committed Oct 9, 2024
1 parent 40b8375 commit c4db282
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/kubernetes_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ def _on_install(self, _) -> None:

def _on_workload_container_pebble_ready(self, _) -> None:
self.unit.set_workload_version(self.get_workload(event=None).version)
self.reconcile()


if __name__ == "__main__":
Expand Down
5 changes: 0 additions & 5 deletions src/relations/cos.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ def __init__(self, charm_: "abstract_charm.MySQLRouterCharm", container_: contai
self._charm = charm_
self._container = container_

charm_.framework.observe(
charm_.on[self._METRICS_RELATION_NAME].relation_broken,
charm_.reconcile,
)

self._secrets = relations.secrets.RelationSecrets(
charm_,
self._PEER_RELATION_NAME,
Expand Down
2 changes: 0 additions & 2 deletions src/relations/database_provides.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ class RelationEndpoint:

def __init__(self, charm_: "abstract_charm.MySQLRouterCharm") -> None:
self._interface = data_interfaces.DatabaseProvides(charm_, relation_name=self._NAME)
charm_.framework.observe(charm_.on[self._NAME].relation_created, charm_.reconcile)
charm_.framework.observe(self._interface.on.database_requested, charm_.reconcile)
charm_.framework.observe(charm_.on[self._NAME].relation_broken, charm_.reconcile)

def external_connectivity(self, event) -> bool:
"""Whether any of the relations are marked as external."""
Expand Down
2 changes: 0 additions & 2 deletions src/relations/database_requires.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ def __init__(self, charm_: "abstract_charm.MySQLRouterCharm") -> None:
database_name="mysql_innodb_cluster_metadata",
extra_user_roles="mysqlrouter",
)
charm_.framework.observe(charm_.on[self._NAME].relation_created, charm_.reconcile)
charm_.framework.observe(self._interface.on.database_created, charm_.reconcile)
charm_.framework.observe(self._interface.on.endpoints_changed, charm_.reconcile)
charm_.framework.observe(charm_.on[self._NAME].relation_broken, charm_.reconcile)

def get_connection_info(self, *, event) -> typing.Optional[CompleteConnectionInformation]:
"""Information for connection to MySQL cluster"""
Expand Down

0 comments on commit c4db282

Please sign in to comment.