Adding cluster-issuer annotation for TLS provisioning
[osm/devops.git] / installers / charm / kafka-exporter / tests / test_pod_spec.py
index 44d99d8..ad0e412 100644 (file)
@@ -58,7 +58,10 @@ class TestPodSpec(unittest.TestCase):
 
     def test_make_pod_ingress_resources_without_site_url(self) -> NoReturn:
         """Testing make pod ingress resources without site_url."""
-        config = {"site_url": ""}
+        config = {
+            "cluster_issuer": "",
+            "site_url": "",
+        }
         app_name = "kafka-exporter"
         port = 9308
 
@@ -71,6 +74,7 @@ class TestPodSpec(unittest.TestCase):
     def test_make_pod_ingress_resources(self) -> NoReturn:
         """Testing make pod ingress resources."""
         config = {
+            "cluster_issuer": "",
             "site_url": "http://kafka-exporter",
             "ingress_whitelist_source_range": "",
         }
@@ -114,6 +118,7 @@ class TestPodSpec(unittest.TestCase):
         """Testing make pod ingress resources with whitelist_source_range."""
         config = {
             "site_url": "http://kafka-exporter",
+            "cluster_issuer": "",
             "ingress_whitelist_source_range": "0.0.0.0/0",
         }
         app_name = "kafka-exporter"
@@ -160,6 +165,7 @@ class TestPodSpec(unittest.TestCase):
         config = {
             "site_url": "https://kafka-exporter",
             "max_file_size": 0,
+            "cluster_issuer": "",
             "ingress_whitelist_source_range": "",
             "tls_secret_name": "",
         }
@@ -203,6 +209,7 @@ class TestPodSpec(unittest.TestCase):
         config = {
             "site_url": "https://kafka-exporter",
             "max_file_size": 0,
+            "cluster_issuer": "",
             "ingress_whitelist_source_range": "",
             "tls_secret_name": "secret_name",
         }
@@ -289,7 +296,7 @@ class TestPodSpec(unittest.TestCase):
         }
 
         expected_result = [
-            "kafka-exporter",
+            "kafka_exporter",
             "--kafka.server={}:{}".format(
                 relation.get("kafka_host"), relation.get("kafka_port")
             ),
@@ -304,6 +311,7 @@ class TestPodSpec(unittest.TestCase):
         image_info = {"upstream-source": "bitnami/kafka-exporter:latest"}
         config = {
             "site_url": "",
+            "cluster_issuer": "",
         }
         relation_state = {
             "kafka_host": "kafka",
@@ -327,7 +335,7 @@ class TestPodSpec(unittest.TestCase):
                         }
                     ],
                     "envConfig": {},
-                    "command": ["kafka-exporter", "--kafka.server=kafka:9090"],
+                    "command": ["kafka_exporter", "--kafka.server=kafka:9090"],
                     "kubernetes": {
                         "readinessProbe": {
                             "httpGet": {
@@ -366,6 +374,7 @@ class TestPodSpec(unittest.TestCase):
         image_info = {"upstream-source": "bitnami/kafka-exporter:latest"}
         config = {
             "site_url": "https://kafka-exporter",
+            "cluster_issuer": "",
             "tls_secret_name": "kafka-exporter",
             "max_file_size": 0,
             "ingress_whitelist_source_range": "0.0.0.0/0",
@@ -392,7 +401,7 @@ class TestPodSpec(unittest.TestCase):
                         }
                     ],
                     "envConfig": {},
-                    "command": ["kafka-exporter", "--kafka.server=kafka:9090"],
+                    "command": ["kafka_exporter", "--kafka.server=kafka:9090"],
                     "kubernetes": {
                         "readinessProbe": {
                             "httpGet": {
@@ -466,6 +475,7 @@ class TestPodSpec(unittest.TestCase):
         image_info = None
         config = {
             "site_url": "",
+            "cluster_issuer": "",
         }
         relation_state = {
             "kafka_host": "kafka",
@@ -485,6 +495,7 @@ class TestPodSpec(unittest.TestCase):
         image_info = {"upstream-source": "bitnami/kafka-exporter:latest"}
         config = {
             "site_url": "",
+            "cluster_issuer": "",
         }
         relation_state = {}
         app_name = "kafka-exporter"