bind-charmers team mailing list archive
-
bind-charmers team
-
Mailing list archive
-
Message #00032
[Merge] ~barryprice/charm-k8s-bind/+git/charm-k8s-bind:master into charm-k8s-bind:master
Barry Price has proposed merging ~barryprice/charm-k8s-bind/+git/charm-k8s-bind:master into charm-k8s-bind:master.
Commit message:
Cleaned up tests a little, more to follow
Requested reviews:
Bind Charmers (bind-charmers)
For more details, see:
https://code.launchpad.net/~barryprice/charm-k8s-bind/+git/charm-k8s-bind/+merge/387947
--
Your team Bind Charmers is requested to review the proposed merge of ~barryprice/charm-k8s-bind/+git/charm-k8s-bind:master into charm-k8s-bind:master.
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):
"imageDetails": {"imagePath": config["bind_image_path"]},
"ports": ports,
"config": secure_pod_config,
+ "kubernetes": {"readinessProbe": {"exec": {"command": ["/usr/local/bin/dns-check.sh"]}}},
}
],
}
diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py
index 18d2243..714e5bd 100644
--- a/tests/unit/test_charm.py
+++ b/tests/unit/test_charm.py
@@ -4,7 +4,7 @@ from charm import BindK8sCharm
from ops import testing
-EMPTY_CONFIG = {
+CONFIG_EMPTY= {
'bind_image_path': '',
'bind_image_username': '',
'bind_image_password': '',
@@ -14,6 +14,16 @@ EMPTY_CONFIG = {
'https_proxy': '',
}
+CONFIG_IMAGE_PASSWORD_MISSING = {
+ 'bind_image_path': 'example.com/bind:v1',
+ 'bind_image_username': 'username',
+ 'bind_image_password': '',
+ 'container_config': '',
+ 'container_secrets': '',
+ 'custom_config_repo': '',
+ 'https_proxy': '',
+}
+
class TestBindK8sCharmHooksDisabled(unittest.TestCase):
def setUp(self):
@@ -22,6 +32,10 @@ class TestBindK8sCharmHooksDisabled(unittest.TestCase):
self.harness.disable_hooks()
def test_check_for_config_problems(self):
- self.harness.update_config(EMPTY_CONFIG)
+ self.harness.update_config(CONFIG_EMPTY)
expected = 'required setting(s) empty: bind_image_path'
self.assertEqual(self.harness.charm._check_for_config_problems(), expected)
+
+ self.harness.update_config(CONFIG_IMAGE_PASSWORD_MISSING)
+ expected = 'required setting(s) empty: bind_image_password'
+ self.assertEqual(self.harness.charm._check_for_config_problems(), expected)
Follow ups