Skip to content

Commit

Permalink
Fix duplicate K8S service ports names (#106)
Browse files Browse the repository at this point in the history
* Fix duplicate K8S service ports names

* Fix expected resources list
  • Loading branch information
marceloneppel authored Mar 14, 2023
1 parent 51aff55 commit 21fbe3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def __init__(self, *args):
charm=self, relation="restart", callback=self._restart
)

postgresql_db_port = ServicePort(5432, name=f"{self.app.name}")
patroni_api_port = ServicePort(8008, name=f"{self.app.name}")
postgresql_db_port = ServicePort(5432, name="database")
patroni_api_port = ServicePort(8008, name="api")
self.service_patcher = KubernetesServicePatch(self, [postgresql_db_port, patroni_api_port])

@property
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,11 @@ def get_expected_k8s_resources(namespace: str, application: str) -> set:
[
f"Endpoints/patroni-{application}-config",
f"Endpoints/patroni-{application}",
f"Endpoints/{application}",
f"Endpoints/{application}-primary",
f"Endpoints/{application}-replicas",
f"Service/patroni-{application}-config",
f"Service/{application}",
]
)

Expand Down

0 comments on commit 21fbe3f

Please sign in to comment.