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

Proposed by Barry Price
Status: Merged
Approved by: Tom Haddon
Approved revision: 7b79565e08f190e3fd5e7e8a69b975a2e3a1d321
Merged at revision: 1c13594b6ba02c056c2bcf5367155b8d7efed25d
Proposed branch: ~barryprice/charm-k8s-bind/+git/charm-k8s-bind:master
Merge into: charm-k8s-bind:master
Diff against target: 54 lines (+17/-2)
2 files modified
src/charm.py (+1/-0)
tests/unit/test_charm.py (+16/-2)
Reviewer Review Type Date Requested Status
Tom Haddon Approve
Canonical IS Reviewers Pending
Review via email: mp+387947@code.launchpad.net

Commit message

Cleaned up tests a little, more to follow

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

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

Change successfully merged at revision 1c13594b6ba02c056c2bcf5367155b8d7efed25d

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 c4d1091..16fabf3 100755
--- a/src/charm.py
+++ b/src/charm.py
@@ -116,6 +116,7 @@ class BindK8sCharm(CharmBase):
116 "imageDetails": {"imagePath": config["bind_image_path"]},116 "imageDetails": {"imagePath": config["bind_image_path"]},
117 "ports": ports,117 "ports": ports,
118 "config": secure_pod_config,118 "config": secure_pod_config,
119 "kubernetes": {"readinessProbe": {"exec": {"command": ["/usr/local/bin/dns-check.sh"]}}},
119 }120 }
120 ],121 ],
121 }122 }
diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py
index 18d2243..a7f7ef0 100644
--- a/tests/unit/test_charm.py
+++ b/tests/unit/test_charm.py
@@ -4,7 +4,7 @@ from charm import BindK8sCharm
44
5from ops import testing5from ops import testing
66
7EMPTY_CONFIG = {7CONFIG_EMPTY = {
8 'bind_image_path': '',8 'bind_image_path': '',
9 'bind_image_username': '',9 'bind_image_username': '',
10 'bind_image_password': '',10 'bind_image_password': '',
@@ -14,6 +14,16 @@ EMPTY_CONFIG = {
14 'https_proxy': '',14 'https_proxy': '',
15}15}
1616
17CONFIG_IMAGE_PASSWORD_MISSING = {
18 'bind_image_path': 'example.com/bind:v1',
19 'bind_image_username': 'username',
20 'bind_image_password': '',
21 'container_config': '',
22 'container_secrets': '',
23 'custom_config_repo': '',
24 'https_proxy': '',
25}
26
1727
18class TestBindK8sCharmHooksDisabled(unittest.TestCase):28class TestBindK8sCharmHooksDisabled(unittest.TestCase):
19 def setUp(self):29 def setUp(self):
@@ -22,6 +32,10 @@ class TestBindK8sCharmHooksDisabled(unittest.TestCase):
22 self.harness.disable_hooks()32 self.harness.disable_hooks()
2333
24 def test_check_for_config_problems(self):34 def test_check_for_config_problems(self):
25 self.harness.update_config(EMPTY_CONFIG)35 self.harness.update_config(CONFIG_EMPTY)
26 expected = 'required setting(s) empty: bind_image_path'36 expected = 'required setting(s) empty: bind_image_path'
27 self.assertEqual(self.harness.charm._check_for_config_problems(), expected)37 self.assertEqual(self.harness.charm._check_for_config_problems(), expected)
38
39 self.harness.update_config(CONFIG_IMAGE_PASSWORD_MISSING)
40 expected = 'required setting(s) empty: bind_image_password'
41 self.assertEqual(self.harness.charm._check_for_config_problems(), expected)

Subscribers

People subscribed via source and target branches

to all changes: