Bug 1991 fixed: modified LCM charm secret name to a standardized one 91/11891/2
authorPedro Escaleira <escaleira@av.it.pt>
Fri, 15 Apr 2022 13:54:52 +0000 (14:54 +0100)
committergarciadav <david.garcia@canonical.com>
Fri, 22 Apr 2022 10:22:56 +0000 (12:22 +0200)
Previously, the LCM charm was creating a Kubernetes secret with the name
`lcm-lcm-secret`, to save the credentials for accessing Mongo, while the
other modules' charms where using a name with the format
`<mod_name>-mongodb-secret` to do so. This modification updates the LCM charm
to create this secret in a compliant way with this name format.

Change-Id: I4d91e760e44d1703f246e605d9b70625967556c5
Signed-off-by: Pedro Escaleira <escaleira@av.it.pt>
installers/charm/lcm/src/charm.py

index 16e6f89..7c64418 100755 (executable)
@@ -212,9 +212,9 @@ class LcmCharm(CharmedOsmBase):
         )
 
         # Add secrets to the pod
-        lcm_secret_name = f"{self.app.name}-lcm-secret"
+        mongodb_secret_name = f"{self.app.name}-mongodb-secret"
         pod_spec_builder.add_secret(
-            lcm_secret_name,
+            mongodb_secret_name,
             {
                 "uri": config.mongodb_uri or self.mongodb_client.connection_string,
                 "commonkey": config.database_commonkey,
@@ -253,7 +253,7 @@ class LcmCharm(CharmedOsmBase):
             }
         )
         container_builder.add_secret_envs(
-            secret_name=lcm_secret_name,
+            secret_name=mongodb_secret_name,
             envs={
                 "OSMLCM_DATABASE_URI": "uri",
                 "OSMLCM_DATABASE_COMMONKEY": "commonkey",