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
1diff --git a/src/charm.py b/src/charm.py
2index c4d1091..16fabf3 100755
3--- a/src/charm.py
4+++ b/src/charm.py
5@@ -116,6 +116,7 @@ class BindK8sCharm(CharmBase):
6 "imageDetails": {"imagePath": config["bind_image_path"]},
7 "ports": ports,
8 "config": secure_pod_config,
9+ "kubernetes": {"readinessProbe": {"exec": {"command": ["/usr/local/bin/dns-check.sh"]}}},
10 }
11 ],
12 }
13diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py
14index 18d2243..a7f7ef0 100644
15--- a/tests/unit/test_charm.py
16+++ b/tests/unit/test_charm.py
17@@ -4,7 +4,7 @@ from charm import BindK8sCharm
18
19 from ops import testing
20
21-EMPTY_CONFIG = {
22+CONFIG_EMPTY = {
23 'bind_image_path': '',
24 'bind_image_username': '',
25 'bind_image_password': '',
26@@ -14,6 +14,16 @@ EMPTY_CONFIG = {
27 'https_proxy': '',
28 }
29
30+CONFIG_IMAGE_PASSWORD_MISSING = {
31+ 'bind_image_path': 'example.com/bind:v1',
32+ 'bind_image_username': 'username',
33+ 'bind_image_password': '',
34+ 'container_config': '',
35+ 'container_secrets': '',
36+ 'custom_config_repo': '',
37+ 'https_proxy': '',
38+}
39+
40
41 class TestBindK8sCharmHooksDisabled(unittest.TestCase):
42 def setUp(self):
43@@ -22,6 +32,10 @@ class TestBindK8sCharmHooksDisabled(unittest.TestCase):
44 self.harness.disable_hooks()
45
46 def test_check_for_config_problems(self):
47- self.harness.update_config(EMPTY_CONFIG)
48+ self.harness.update_config(CONFIG_EMPTY)
49 expected = 'required setting(s) empty: bind_image_path'
50 self.assertEqual(self.harness.charm._check_for_config_problems(), expected)
51+
52+ self.harness.update_config(CONFIG_IMAGE_PASSWORD_MISSING)
53+ expected = 'required setting(s) empty: bind_image_password'
54+ self.assertEqual(self.harness.charm._check_for_config_problems(), expected)

Subscribers

People subscribed via source and target branches

to all changes: