From b6f269bfe57c8bfe8394fe58e93422aa96c2a001 Mon Sep 17 00:00:00 2001 From: gatici Date: Tue, 5 Dec 2023 17:09:07 +0300 Subject: [PATCH] Rename SD-Core charms by adding -k8s as a suffix Signed-off-by: gatici --- .github/workflows/main.yaml | 4 ++-- README.md | 22 +++++++++++----------- metadata.yaml | 10 +++++----- src/charm.py | 6 +++--- tests/integration/test_integration.py | 2 +- tests/unit/test_charm.py | 6 +++--- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 6dcec40..b0dcc13 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -27,7 +27,7 @@ jobs: integration-test: uses: canonical/sdcore-github-workflows/.github/workflows/integration-test.yaml@main with: - charm-file-name: "sdcore-amf_ubuntu-22.04-amd64.charm" + charm-file-name: "sdcore-amf-k8s_ubuntu-22.04-amd64.charm" publish-charm: name: Publish Charm @@ -39,7 +39,7 @@ jobs: if: ${{ github.ref_name == 'main' }} uses: canonical/sdcore-github-workflows/.github/workflows/publish-charm.yaml@main with: - charm-file-name: "sdcore-amf_ubuntu-22.04-amd64.charm" + charm-file-name: "sdcore-amf-k8s_ubuntu-22.04-amd64.charm" secrets: inherit lib-needs-publishing: diff --git a/README.md b/README.md index ccfd4d4..d4ff2bf 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# SD-Core AMF Operator (k8s) -[![CharmHub Badge](https://charmhub.io/sdcore-amf/badge.svg)](https://charmhub.io/sdcore-amf) +# SD-Core AMF K8s Operator +[![CharmHub Badge](https://charmhub.io/sdcore-amf-k8s/badge.svg)](https://charmhub.io/sdcore-amf-k8s) -Charmed Operator for SD-Core's Access and Mobility Management Function (AMF). +Charmed K8s Operator for SD-Core's Access and Mobility Management Function (AMF). ## Pre-requisites @@ -11,15 +11,15 @@ Juju model on a Kubernetes cluster. ## Usage ```bash -juju deploy sdcore-amf --trust --channel=edge +juju deploy sdcore-amf-k8s --trust --channel=edge juju deploy mongodb-k8s --trust --channel=5/edge -juju deploy sdcore-nrf --channel=edge +juju deploy sdcore-nrf-k8s --channel=edge juju deploy self-signed-certificates --channel=beta -juju integrate sdcore-nrf:database mongodb-k8s -juju integrate sdcore-nrf:certificates self-signed-certificates:certificates -juju integrate sdcore-amf:database mongodb-k8s -juju integrate sdcore-amf:fiveg-nrf sdcore-nrf:fiveg-nrf -juju integrate sdcore-amf:certificates self-signed-certificates:certificates +juju integrate sdcore-nrf-k8s:database mongodb-k8s +juju integrate sdcore-nrf-k8s:certificates self-signed-certificates:certificates +juju integrate sdcore-amf-k8s:database mongodb-k8s +juju integrate sdcore-amf-k8s:fiveg-nrf sdcore-nrf-k8s:fiveg-nrf +juju integrate sdcore-amf-k8s:certificates self-signed-certificates:certificates ``` ### Overriding external access information for N2 interface @@ -30,7 +30,7 @@ your network configuration, you can override that information through configuration: ```bash -juju config sdcore-amf external-amf-ip=192.168.0.4 external-amf-hostname=amf.example.com +juju config sdcore-amf-k8s external-amf-ip=192.168.0.4 external-amf-hostname=amf.example.com ``` ## Image diff --git a/metadata.yaml b/metadata.yaml index 63494b1..84ca018 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,11 +1,11 @@ -name: sdcore-amf -display-name: SD-Core AMF +name: sdcore-amf-k8s +display-name: SD-Core AMF K8s summary: A Charmed Operator for SD-Core's Access and Mobility Management Function (AMF). description: | A Charmed Operator for SD-Core's Access and Mobility Management Function (AMF). -website: https://charmhub.io/sdcore-amf -source: https://github.com/canonical/sdcore-amf-operator -issues: https://github.com/canonical/sdcore-amf-operator/issues +website: https://charmhub.io/sdcore-amf-k8s +source: https://github.com/canonical/sdcore-amf-k8s-operator +issues: https://github.com/canonical/sdcore-amf-k8s-operator/issues containers: amf: diff --git a/src/charm.py b/src/charm.py index 2f7778f..57497b7 100755 --- a/src/charm.py +++ b/src/charm.py @@ -57,8 +57,8 @@ DEFAULT_FIELD_MANAGER = "controller" -class AMFOperatorCharm(CharmBase): - """Main class to describe juju event handling for the SD-Core AMF operator.""" +class AMFK8sOperatorCharm(CharmBase): + """Main class to describe juju event handling for the SD-Core AMF K8s operator.""" def __init__(self, *args): super().__init__(*args) @@ -693,4 +693,4 @@ def _get_pod_ip() -> Optional[str]: if __name__ == "__main__": # pragma: no cover - main(AMFOperatorCharm) + main(AMFK8sOperatorCharm) diff --git a/tests/integration/test_integration.py b/tests/integration/test_integration.py index e7a2524..266efcc 100644 --- a/tests/integration/test_integration.py +++ b/tests/integration/test_integration.py @@ -15,7 +15,7 @@ METADATA = yaml.safe_load(Path("./metadata.yaml").read_text()) APP_NAME = METADATA["name"] DB_CHARM_NAME = "mongodb-k8s" -NRF_CHARM_NAME = "sdcore-nrf" +NRF_CHARM_NAME = "sdcore-nrf-k8s" TLS_PROVIDER_CHARM_NAME = "self-signed-certificates" diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py index d5134a2..82fa5cf 100644 --- a/tests/unit/test_charm.py +++ b/tests/unit/test_charm.py @@ -10,13 +10,13 @@ from ops import testing from ops.model import ActiveStatus, BlockedStatus, WaitingStatus -from charm import AMFOperatorCharm +from charm import AMFK8sOperatorCharm class TestCharm(unittest.TestCase): def setUp(self): self.namespace = "whatever" - self.harness = testing.Harness(AMFOperatorCharm) + self.harness = testing.Harness(AMFK8sOperatorCharm) self.harness.set_model_name(name=self.namespace) self.addCleanup(self.harness.cleanup) self.harness.set_leader(is_leader=True) @@ -618,7 +618,7 @@ def test_given_n2_information_and_service_is_running_and_lb_service_has_no_hostn ) self.assertEqual(relation_data["amf_ip_address"], "2.2.2.2") self.assertEqual( - relation_data["amf_hostname"], "sdcore-amf-external.whatever.svc.cluster.local" + relation_data["amf_hostname"], "sdcore-amf-k8s-external.whatever.svc.cluster.local" ) self.assertEqual(relation_data["amf_port"], "38412")