Add enable_web_admin_api config to prometheus charm
Unit tests fixed
Change-Id: I8400794918780f929ad7612f72d477d37aee1b74
Signed-off-by: David Garcia <david.garcia@canonical.com>
diff --git a/installers/charm/prometheus/src/pod_spec.py b/installers/charm/prometheus/src/pod_spec.py
index 541cf3e..202114e 100644
--- a/installers/charm/prometheus/src/pod_spec.py
+++ b/installers/charm/prometheus/src/pod_spec.py
@@ -95,6 +95,7 @@
"tls_secret_name": lambda value, _: isinstance(value, str)
if value is not None
else True,
+ "enable_web_admin_api": lambda value, _: isinstance(value, bool),
}
relation_validators = {}
problems = []
@@ -307,9 +308,7 @@
Returns:
List[str]: command to startup the process.
"""
- return [
- "sh",
- "-c",
+ command = [
"/bin/prometheus",
"--config.file=/etc/prometheus/prometheus.yml",
"--storage.tsdb.path=/prometheus",
@@ -320,6 +319,9 @@
port, config.get("web_subpath")
),
]
+ if config.get("enable_web_admin_api"):
+ command.append("--web.enable-admin-api")
+ return command
def make_pod_spec(