Merge ~mthaddon/charm-k8s-ingress/+git/charm-k8s-ingress:custom-on-relation into charm-k8s-ingress:master

Proposed by Tom Haddon
Status: Merged
Approved by: Jon Seager
Approved revision: 93db9d67df97ed9db6eb07e54bbaf83588fee75f
Merged at revision: ec2a890b14f6b8eb9b9da69060a2f6fc378e4fc1
Proposed branch: ~mthaddon/charm-k8s-ingress/+git/charm-k8s-ingress:custom-on-relation
Merge into: charm-k8s-ingress:master
Diff against target: 66 lines (+11/-11)
2 files modified
lib/charms/ingress/v0/ingress.py (+9/-2)
src/charm.py (+2/-9)
Reviewer Review Type Date Requested Status
🤖 prod-jenkaas-is (community) continuous-integration Approve
ingress-charmers Pending
Review via email: mp+400784@code.launchpad.net

Commit message

Move the IngressCharmEvents class into the relation library

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 :

FAILED: Continuous integration, rev:e112b1f129ad918ec289a0b5588aaf88ce74b053
https://jenkins.canonical.com/is/job/lp-charm-k8s-ingress-ci/31/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/is/job/lp-charm-test/67/
    None: https://jenkins.canonical.com/is/job/lp-update-mp/77419/

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

review: Needs Fixing (continuous-integration)
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:93db9d67df97ed9db6eb07e54bbaf83588fee75f
https://jenkins.canonical.com/is/job/lp-charm-k8s-ingress-ci/32/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/is/job/lp-charm-test/68/
    None: https://jenkins.canonical.com/is/job/lp-update-mp/77455/

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

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

Change successfully merged at revision ec2a890b14f6b8eb9b9da69060a2f6fc378e4fc1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/charms/ingress/v0/ingress.py b/lib/charms/ingress/v0/ingress.py
2index f825fbb..2412e06 100644
3--- a/lib/charms/ingress/v0/ingress.py
4+++ b/lib/charms/ingress/v0/ingress.py
5@@ -32,7 +32,8 @@ self.ingress.update_config({"service-hostname": self.config["external_hostname"]
6
7 import logging
8
9-from ops.framework import EventBase, Object
10+from ops.charm import CharmEvents
11+from ops.framework import EventBase, EventSource, Object
12 from ops.model import BlockedStatus
13
14 # The unique Charmhub library identifier, never change it
15@@ -43,7 +44,7 @@ LIBAPI = 0
16
17 # Increment this PATCH version before using `charmcraft push-lib` or reset
18 # to 0 if you are raising the major API version
19-LIBPATCH = 6
20+LIBPATCH = 7
21
22 logger = logging.getLogger(__name__)
23
24@@ -65,6 +66,12 @@ class IngressAvailableEvent(EventBase):
25 pass
26
27
28+class IngressCharmEvents(CharmEvents):
29+ """Custom charm events."""
30+
31+ ingress_available = EventSource(IngressAvailableEvent)
32+
33+
34 class IngressRequires(Object):
35 """This class defines the functionality for the 'requires' side of the 'ingress' relation.
36
37diff --git a/src/charm.py b/src/charm.py
38index c7cf6be..17ee96d 100755
39--- a/src/charm.py
40+++ b/src/charm.py
41@@ -9,11 +9,10 @@ from pathlib import Path
42 import kubernetes
43
44 from charms.ingress.v0.ingress import (
45- IngressAvailableEvent,
46+ IngressCharmEvents,
47 IngressProvides,
48 )
49-from ops.charm import CharmBase, CharmEvents
50-from ops.framework import EventSource
51+from ops.charm import CharmBase
52 from ops.main import main
53 from ops.model import ActiveStatus
54
55@@ -40,12 +39,6 @@ def _fix_lp_1892255():
56 )
57
58
59-class IngressCharmEvents(CharmEvents):
60- """Custom charm events."""
61-
62- ingress_available = EventSource(IngressAvailableEvent)
63-
64-
65 class IngressCharm(CharmBase):
66 """Charm the service."""
67

Subscribers

People subscribed via source and target branches

to all changes: