Skip to content

Commit

Permalink
Support juju expose (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlcsaposs-canonical authored Sep 14, 2023
1 parent 899006a commit 876b256
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/kubernetes_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ def _patch_service(self) -> None:
# =======================

def _on_install(self, _) -> None:
"""Patch existing k8s service to include read-write and read-only services."""
"""Open ports & patch k8s service."""
if ops.JujuVersion.from_environ().supports_open_port_on_k8s:
for port in (self._READ_WRITE_PORT, self._READ_ONLY_PORT, 6448, 6449):
self.unit.open_port("tcp", port)
if not self.unit.is_leader():
return
try:
Expand Down

0 comments on commit 876b256

Please sign in to comment.