(charmed-osm) Add auth to prometheus and update kafka/zk
[osm/devops.git] / installers / charm / mon / src / charm.py
index 917b54a..85d1fa4 100755 (executable)
@@ -157,7 +157,10 @@ class MonCharm(CharmedOsmBase):
     def _check_missing_dependencies(self, config: ConfigModel):
         missing_relations = []
 
-        if self.kafka_client.is_missing_data_in_unit():
+        if (
+            self.kafka_client.is_missing_data_in_unit()
+            and self.kafka_client.is_missing_data_in_app()
+        ):
             missing_relations.append("kafka")
         if not config.mongodb_uri and self.mongodb_client.is_missing_data_in_unit():
             missing_relations.append("mongodb")
@@ -260,6 +263,15 @@ class MonCharm(CharmedOsmBase):
                 "OSMMON_PROMETHEUS_URL": f"http://{self.prometheus_client.hostname}:{self.prometheus_client.port}",
             }
         )
+        prometheus_user = self.prometheus_client.user
+        prometheus_password = self.prometheus_client.password
+        if prometheus_user and prometheus_password:
+            container_builder.add_envs(
+                {
+                    "OSMMON_PROMETHEUS_USER": prometheus_user,
+                    "OSMMON_PROMETHEUS_PASSWORD": prometheus_password,
+                }
+            )
         container_builder.add_secret_envs(
             secret_name=mongodb_secret_name,
             envs={