Merge ~barryprice/charm-k8s-bind/+git/charm-k8s-bind:docstrings into charm-k8s-bind:master

Proposed by Barry Price
Status: Merged
Approved by: Tom Haddon
Approved revision: 0da9ca191ede081b179a187bef81ba09a6b3f516
Merged at revision: 56b7767a928d4277efd177046867e299d398b75c
Proposed branch: ~barryprice/charm-k8s-bind/+git/charm-k8s-bind:docstrings
Merge into: charm-k8s-bind:master
Diff against target: 44 lines (+6/-5)
1 file modified
src/charm.py (+6/-5)
Reviewer Review Type Date Requested Status
Tom Haddon Approve
Canonical IS Reviewers Pending
Review via email: mp+388527@code.launchpad.net

Commit message

Add missing docstrings, remove a useless method that only ever called another one

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
Tom Haddon (mthaddon) wrote :

LGTM, thx

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

Change successfully merged at revision 56b7767a928d4277efd177046867e299d398b75c

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 8754cfa..913f69f 100755
3--- a/src/charm.py
4+++ b/src/charm.py
5@@ -18,6 +18,7 @@ REQUIRED_SETTINGS = ['bind_image_path']
6
7 class BindK8sCharm(CharmBase):
8 def __init__(self, *args):
9+ """Initialise our class, we only care about 'start' and 'config-changed' hooks."""
10 super().__init__(*args)
11 self.framework.observe(self.on.start, self.on_config_changed)
12 self.framework.observe(self.on.config_changed, self.on_config_changed)
13@@ -47,11 +48,9 @@ class BindK8sCharm(CharmBase):
14 return sorted(list(set(missing)))
15
16 def on_config_changed(self, event):
17- self.configure_pod()
18-
19- def configure_pod(self):
20- # Only the leader can set_spec().
21+ """Check that we're leader, and if so, set up the pod."""
22 if self.model.unit.is_leader():
23+ # Only the leader can set_spec().
24 resources = self.make_pod_resources()
25 spec = self.make_pod_spec()
26 spec.update(resources)
27@@ -69,7 +68,8 @@ class BindK8sCharm(CharmBase):
28 self.model.unit.status = ActiveStatus()
29
30 def make_pod_resources(self):
31- """LP#1889746: We should define a manual ingress here to work around LP#1889703."""
32+ """Compile and return our pod resources (e.g. ingresses)."""
33+ # LP#1889746: We need to define a manual ingress here to work around LP#1889703.
34 resources = {} # TODO
35 out = io.StringIO()
36 pprint(resources, out)
37@@ -107,6 +107,7 @@ class BindK8sCharm(CharmBase):
38 return pod_config
39
40 def make_pod_spec(self):
41+ """Set up and return our full pod spec here."""
42 config = self.model.config
43 full_pod_config = self.generate_pod_config(secured=False)
44 secure_pod_config = self.generate_pod_config(secured=True)

Subscribers

People subscribed via source and target branches

to all changes: