Fix bug 1547: Add ingress.class annotation to OSM charms
[osm/devops.git] / installers / charm / nbi / src / charm.py
index 550c88b..0af4104 100755 (executable)
@@ -210,7 +210,8 @@ class NbiCharm(CharmedOsmBase):
                 "OSMNBI_STORAGE_DRIVER": "mongo",
                 "OSMNBI_STORAGE_PATH": "/app/storage",
                 "OSMNBI_STORAGE_COLLECTION": "files",
-                "OSMNBI_STORAGE_URI": self.mongodb_client.connection_string,
+                "OSMNBI_STORAGE_URI": config.mongodb_uri
+                or self.mongodb_client.connection_string,
                 # Prometheus configuration
                 "OSMNBI_PROMETHEUS_HOST": self.prometheus_client.hostname,
                 "OSMNBI_PROMETHEUS_PORT": self.prometheus_client.port,
@@ -248,6 +249,7 @@ class NbiCharm(CharmedOsmBase):
                     else config.max_file_size
                 ),
                 "nginx.ingress.kubernetes.io/backend-protocol": "HTTPS",
+                "kubernetes.io/ingress.class": "public",
             }
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations