Merge ~mthaddon/charm-k8s-ingress/+git/charm-k8s-ingress:rename into charm-k8s-ingress:master

Proposed by Tom Haddon
Status: Merged
Approved by: Jon Seager
Approved revision: 831822a2507222477102ff670dd3eb166ff984a4
Merged at revision: 9a7d7511deaba135ff954b8f00c434fb30b96a6a
Proposed branch: ~mthaddon/charm-k8s-ingress/+git/charm-k8s-ingress:rename
Merge into: charm-k8s-ingress:master
Diff against target: 182 lines (+20/-20)
6 files modified
Makefile (+2/-2)
README.md (+4/-4)
lib/charms/nginx_ingress_integrator/v0/ingress.py (+3/-3)
metadata.yaml (+1/-1)
src/charm.py (+3/-3)
tests/unit/test_charm.py (+7/-7)
Reviewer Review Type Date Requested Status
🤖 prod-jenkaas-is (community) continuous-integration Approve
ingress-charmers Pending
Review via email: mp+400960@code.launchpad.net

Commit message

Rename charm to nginx-ingress-integrator

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 prod-jenkaas-is (prod-jenkaas-is) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 prod-jenkaas-is (prod-jenkaas-is) wrote :

PASSED: Continuous integration, rev:831822a2507222477102ff670dd3eb166ff984a4
https://jenkins.canonical.com/is/job/lp-charm-k8s-ingress-ci/35/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/is/job/lp-charm-test/72/
    None: https://jenkins.canonical.com/is/job/lp-update-mp/85593/

Click here to trigger a rebuild:
https://jenkins.canonical.com/is/job/lp-charm-k8s-ingress-ci/35//rebuild

review: Approve (continuous-integration)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 9a7d7511deaba135ff954b8f00c434fb30b96a6a

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2index c371fc0..5acb151 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -8,7 +8,7 @@ lint: blacken
6
7 # We actually use the build directory created by charmcraft,
8 # but the .charm file makes a much more convenient sentinel.
9-unittest: ingress.charm
10+unittest: nginx-ingress-integrator.charm
11 @tox -e unit
12
13 test: lint unittest
14@@ -17,7 +17,7 @@ clean:
15 @echo "Cleaning files"
16 @git clean -fXd
17
18-ingress.charm: src/*.py requirements.txt
19+nginx-ingress-integrator.charm: src/*.py requirements.txt
20 charmcraft build
21
22 .PHONY: lint test unittest clean
23diff --git a/README.md b/README.md
24index 55b9e33..dd63bdf 100644
25--- a/README.md
26+++ b/README.md
27@@ -2,7 +2,7 @@
28
29 ## Description
30
31-This charm is intended to provide an ingress for sidecar charms using the
32+This charm is intended to provide an nginx ingress for sidecar charms using the
33 Operator Framework until such time as Juju can expose the relevant primitives
34 to enable charms to configure an ingress natively via Juju (e.g. with TLS as
35 required, with session affinity as required, allowing for upload of a given
36@@ -29,7 +29,7 @@ which should be set to the contents of your kubernetes client configuration.
37 If you're using microk8s you can get this via `microk8s config`. As an example
38 you could deploy this charm as follows:
39 ```
40-juju deploy ./ingress.charm --resource placeholder-image='google/pause' --config kube-config="$(microk8s config)"
41+juju deploy ./nginx-ingress-integrator.charm ingress --resource placeholder-image='google/pause' --config kube-config="$(microk8s config)"
42 ```
43 To create an ingress for your service, you'd then add a relation to a charm
44 that supports the `ingress` relation. As an example:
45@@ -42,7 +42,7 @@ called `gunicorn-service`. The gunicorn charm in question, which can be found
46 https://code.launchpad.net/~mthaddon/charm-k8s-gunicorn/+git/charm-k8s-gunicorn/+ref/pebble
47 implements the relation using the ingress library, as a trivial example:
48 ```
49-from charms.ingress.v0.ingress import IngressRequires
50+from charms.nginx_ingress_integrator.v0.ingress import IngressRequires
51
52 # In __init__:
53 self.ingress = IngressRequires(self, self.config["external_hostname"], self.app.name, 80)
54@@ -63,7 +63,7 @@ can still override the configuration of the ingress using Juju config. Using
55 the above example, where your charm sets the `service-port` as "80" in the
56 relation, you could override this by doing the following:
57 ```
58-juju deploy ./ingress.charm --resource placeholder-image='google/pause' --config kube-config="$(microk8s config)"
59+juju deploy ./nginx-ingress-integrator.charm ingress --resource placeholder-image='google/pause' --config kube-config="$(microk8s config)"
60 juju deploy ./gunicorn.charm --resource gunicorn-image='gunicorncharmers/gunicorn-app:edge'
61 juju relate ingress gunicorn
62 juju config ingress service-port=8080
63diff --git a/lib/charms/ingress/v0/ingress.py b/lib/charms/nginx_ingress_integrator/v0/ingress.py
64similarity index 97%
65rename from lib/charms/ingress/v0/ingress.py
66rename to lib/charms/nginx_ingress_integrator/v0/ingress.py
67index e002f18..65d08a7 100644
68--- a/lib/charms/ingress/v0/ingress.py
69+++ b/lib/charms/nginx_ingress_integrator/v0/ingress.py
70@@ -23,7 +23,7 @@ See `config.yaml` for descriptions of each, along with the required type.
71
72 As an example:
73 ```
74-from charms.ingress.v0.ingress import IngressRequires
75+from charms.nginx_ingress_integrator.v0.ingress import IngressRequires
76
77 # In your charm's `__init__` method.
78 self.ingress = IngressRequires(self, {"service-hostname": self.config["external_hostname"],
79@@ -42,14 +42,14 @@ from ops.framework import EventBase, EventSource, Object
80 from ops.model import BlockedStatus
81
82 # The unique Charmhub library identifier, never change it
83-LIBID = "2d35a009b0d64fe186c99a8c9e53c6ab"
84+LIBID = "db0af4367506491c91663468fb5caa4c"
85
86 # Increment this major API version when introducing breaking changes
87 LIBAPI = 0
88
89 # Increment this PATCH version before using `charmcraft push-lib` or reset
90 # to 0 if you are raising the major API version
91-LIBPATCH = 9
92+LIBPATCH = 1
93
94 logger = logging.getLogger(__name__)
95
96diff --git a/metadata.yaml b/metadata.yaml
97index 34313d9..c29373d 100644
98--- a/metadata.yaml
99+++ b/metadata.yaml
100@@ -1,6 +1,6 @@
101 # Copyright 2021 Canonical Ltd.
102 # See LICENSE file for licensing details.
103-name: ingress
104+name: nginx-ingress-integrator
105 description: |
106 An operator to configure a kubernetes ingress.
107 summary: |
108diff --git a/src/charm.py b/src/charm.py
109index 3531e9d..dcba16a 100755
110--- a/src/charm.py
111+++ b/src/charm.py
112@@ -8,7 +8,7 @@ from pathlib import Path
113
114 import kubernetes
115
116-from charms.ingress.v0.ingress import (
117+from charms.nginx_ingress_integrator.v0.ingress import (
118 IngressCharmEvents,
119 IngressProvides,
120 )
121@@ -39,7 +39,7 @@ def _fix_lp_1892255():
122 )
123
124
125-class IngressCharm(CharmBase):
126+class NginxIngressCharm(CharmBase):
127 """Charm the service."""
128
129 _authed = False
130@@ -337,4 +337,4 @@ class IngressCharm(CharmBase):
131
132
133 if __name__ == "__main__": # pragma: no cover
134- main(IngressCharm)
135+ main(NginxIngressCharm)
136diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py
137index 9fa2a77..8c1a286 100644
138--- a/tests/unit/test_charm.py
139+++ b/tests/unit/test_charm.py
140@@ -12,19 +12,19 @@ from ops.model import (
141 BlockedStatus,
142 )
143 from ops.testing import Harness
144-from charm import IngressCharm
145+from charm import NginxIngressCharm
146
147
148 class TestCharm(unittest.TestCase):
149 def setUp(self):
150 """Setup the harness object."""
151- self.harness = Harness(IngressCharm)
152+ self.harness = Harness(NginxIngressCharm)
153 self.addCleanup(self.harness.cleanup)
154 self.harness.begin()
155
156- @patch('charm.IngressCharm._report_service_ips')
157- @patch('charm.IngressCharm._define_ingress')
158- @patch('charm.IngressCharm._define_service')
159+ @patch('charm.NginxIngressCharm._report_service_ips')
160+ @patch('charm.NginxIngressCharm._define_ingress')
161+ @patch('charm.NginxIngressCharm._define_service')
162 def test_config_changed(self, _define_service, _define_ingress, _report_service_ips):
163 """Test our config changed handler."""
164 # First of all test, with leader set to True.
165@@ -226,7 +226,7 @@ class TestCharm(unittest.TestCase):
166 # Now it's the value from the relation.
167 self.assertEqual(self.harness.charm._tls_secret_name, "gunicorn-tls-new")
168
169- @patch('charm.IngressCharm._on_config_changed')
170+ @patch('charm.NginxIngressCharm._on_config_changed')
171 def test_on_ingress_relation_changed(self, _on_config_changed):
172 """Test ingress relation changed handler."""
173 # Confirm we do nothing if we're not the leader.
174@@ -245,7 +245,7 @@ class TestCharm(unittest.TestCase):
175 with self.assertLogs(level="ERROR") as logger:
176 self.harness.update_relation_data(relation_id, 'gunicorn', relations_data)
177 msg = (
178- "ERROR:charms.ingress.v0.ingress:Missing required data fields for "
179+ "ERROR:charms.nginx_ingress_integrator.v0.ingress:Missing required data fields for "
180 "ingress relation: service-hostname, service-port"
181 )
182 self.assertEqual(sorted(logger.output), [msg])

Subscribers

People subscribed via source and target branches

to all changes: