Skip to content

Commit

Permalink
Replacing KubernetesServicePatch with ops.set_ports
Browse files Browse the repository at this point in the history
  • Loading branch information
Gmerold committed Dec 1, 2023
1 parent 43e86db commit ce3d226
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 357 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ A Charmed Operator for SD-Core's Policy Control Function (PCF) component.

```bash
juju deploy mongodb-k8s --channel 5/edge --trust
juju deploy sdcore-nrf --channel edge --trust
juju deploy sdcore-pcf --channel edge --trust
juju deploy sdcore-nrf --channel edge
juju deploy sdcore-pcf --channel edge
juju deploy self-signed-certificates --channel=beta

juju integrate sdcore-pcf mongodb-k8s
Expand Down
341 changes: 0 additions & 341 deletions lib/charms/observability_libs/v1/kubernetes_service_patch.py

This file was deleted.

2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
jinja2
lightkube
lightkube-models
ops
pydantic
pytest-interface-tester
Expand Down
9 changes: 1 addition & 8 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
from typing import Optional

from charms.data_platform_libs.v0.data_interfaces import DatabaseRequires # type: ignore[import]
from charms.observability_libs.v1.kubernetes_service_patch import ( # type: ignore[import] # noqa: E501
KubernetesServicePatch,
)
from charms.sdcore_nrf.v0.fiveg_nrf import NRFRequires # type: ignore[import]
from charms.tls_certificates_interface.v2.tls_certificates import ( # type: ignore[import]
CertificateAvailableEvent,
Expand All @@ -22,7 +19,6 @@
generate_private_key,
)
from jinja2 import Environment, FileSystemLoader
from lightkube.models.core_v1 import ServicePort
from ops.charm import CharmBase
from ops.framework import EventBase
from ops.main import main
Expand Down Expand Up @@ -59,10 +55,7 @@ def __init__(self, *args):
self, relation_name="database", database_name=DATABASE_NAME
)
self._nrf_requires = NRFRequires(charm=self, relation_name=NRF_RELATION_NAME)
self._service_patcher = KubernetesServicePatch(
charm=self,
ports=[ServicePort(name="sbi", port=PCF_SBI_PORT)],
)
self.unit.set_ports(PCF_SBI_PORT)
self._certificates = TLSCertificatesRequiresV2(self, "certificates")
self.framework.observe(self.on.database_relation_joined, self._configure_sdcore_pcf)
self.framework.observe(self.on.database_relation_broken, self._on_database_relation_broken)
Expand Down
Loading

0 comments on commit ce3d226

Please sign in to comment.