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

Proposed by Tom Haddon
Status: Merged
Approved by: Jon Seager
Approved revision: 79dc2579eb153389ff28f2a6796da67d5113619b
Merged at revision: 79873e183a801ed2a9e235fbc965d7cbe81943e0
Proposed branch: ~mthaddon/charm-k8s-ingress/+git/charm-k8s-ingress:patch-service
Merge into: charm-k8s-ingress:master
Diff against target: 32 lines (+2/-12)
1 file modified
src/charm.py (+2/-12)
Reviewer Review Type Date Requested Status
🤖 prod-jenkaas-is (community) continuous-integration Approve
ingress-charmers Pending
Review via email: mp+400462@code.launchpad.net

Commit message

Use patch_namespaced_service to deal with updates to a service we've already defined

Description of the change

Use patch_namespaced_service to deal with updates to a service we've already defined

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:79dc2579eb153389ff28f2a6796da67d5113619b
https://jenkins.canonical.com/is/job/lp-charm-k8s-ingress-ci/18/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/is/job/lp-charm-test/50/
    None: https://jenkins.canonical.com/is/job/lp-update-mp/61477/

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

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

Change successfully merged at revision 79873e183a801ed2a9e235fbc965d7cbe81943e0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/charm.py b/src/charm.py
2index 0903459..7a8d5dc 100755
3--- a/src/charm.py
4+++ b/src/charm.py
5@@ -268,19 +268,9 @@ class CharmK8SIngressCharm(CharmBase):
6 body = self._get_k8s_service()
7 services = api.list_namespaced_service(namespace=self._namespace)
8 if self._k8s_service_name in [x.metadata.name for x in services.items]:
9- # Currently failing with port[1].name required but we're only
10- # defining one port above...
11- # api.patch_namespaced_service(
12- # name=service_name,
13- # namespace=self._namespace,
14- # body=body,
15- # )
16- api.delete_namespaced_service(
17+ api.patch_namespaced_service(
18 name=self._k8s_service_name,
19 namespace=self._namespace,
20- )
21- api.create_namespaced_service(
22- namespace=self._namespace,
23 body=body,
24 )
25 logger.info(
26@@ -341,5 +331,5 @@ class CharmK8SIngressCharm(CharmBase):
27 self.unit.status = ActiveStatus(msg)
28
29
30-if __name__ == "__main__":
31+if __name__ == "__main__": # pragma: no cover
32 main(CharmK8SIngressCharm)

Subscribers

People subscribed via source and target branches

to all changes: