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
diff --git a/src/charm.py b/src/charm.py
index 8754cfa..913f69f 100755
--- a/src/charm.py
+++ b/src/charm.py
@@ -18,6 +18,7 @@ REQUIRED_SETTINGS = ['bind_image_path']
1818
19class BindK8sCharm(CharmBase):19class BindK8sCharm(CharmBase):
20 def __init__(self, *args):20 def __init__(self, *args):
21 """Initialise our class, we only care about 'start' and 'config-changed' hooks."""
21 super().__init__(*args)22 super().__init__(*args)
22 self.framework.observe(self.on.start, self.on_config_changed)23 self.framework.observe(self.on.start, self.on_config_changed)
23 self.framework.observe(self.on.config_changed, self.on_config_changed)24 self.framework.observe(self.on.config_changed, self.on_config_changed)
@@ -47,11 +48,9 @@ class BindK8sCharm(CharmBase):
47 return sorted(list(set(missing)))48 return sorted(list(set(missing)))
4849
49 def on_config_changed(self, event):50 def on_config_changed(self, event):
50 self.configure_pod()51 """Check that we're leader, and if so, set up the pod."""
51
52 def configure_pod(self):
53 # Only the leader can set_spec().
54 if self.model.unit.is_leader():52 if self.model.unit.is_leader():
53 # Only the leader can set_spec().
55 resources = self.make_pod_resources()54 resources = self.make_pod_resources()
56 spec = self.make_pod_spec()55 spec = self.make_pod_spec()
57 spec.update(resources)56 spec.update(resources)
@@ -69,7 +68,8 @@ class BindK8sCharm(CharmBase):
69 self.model.unit.status = ActiveStatus()68 self.model.unit.status = ActiveStatus()
7069
71 def make_pod_resources(self):70 def make_pod_resources(self):
72 """LP#1889746: We should define a manual ingress here to work around LP#1889703."""71 """Compile and return our pod resources (e.g. ingresses)."""
72 # LP#1889746: We need to define a manual ingress here to work around LP#1889703.
73 resources = {} # TODO73 resources = {} # TODO
74 out = io.StringIO()74 out = io.StringIO()
75 pprint(resources, out)75 pprint(resources, out)
@@ -107,6 +107,7 @@ class BindK8sCharm(CharmBase):
107 return pod_config107 return pod_config
108108
109 def make_pod_spec(self):109 def make_pod_spec(self):
110 """Set up and return our full pod spec here."""
110 config = self.model.config111 config = self.model.config
111 full_pod_config = self.generate_pod_config(secured=False)112 full_pod_config = self.generate_pod_config(secured=False)
112 secure_pod_config = self.generate_pod_config(secured=True)113 secure_pod_config = self.generate_pod_config(secured=True)

Subscribers

People subscribed via source and target branches

to all changes: