Remove api_proxy from osm bundles 33/9433/4
authorDavid Garcia <david.garcia@canonical.com>
Thu, 16 Jul 2020 12:51:49 +0000 (14:51 +0200)
committergarciadav <david.garcia@canonical.com>
Fri, 17 Jul 2020 14:55:25 +0000 (16:55 +0200)
Change-Id: I942df7a05859f78ef1dd433e55985fa03b514219
Signed-off-by: David Garcia <david.garcia@canonical.com>
installers/charm/bundles/osm-ha/bundle.yaml
installers/charm/bundles/osm/bundle.yaml
installers/charm/lcm-k8s/reactive/lcm.py
installers/charm/lcm-k8s/reactive/spec_template.yaml

index c6f0249..9976679 100644 (file)
@@ -145,7 +145,6 @@ applications:
       vca_password: secret
       vca_pubkey: pubkey
       vca_cacert: cacert
-      vca_apiproxy: apiproxy
       use_external_vca: true
       DATABASE_COMMONKEY: osm
     annotations:
index 7f712e2..6207fd8 100644 (file)
@@ -145,7 +145,6 @@ applications:
       vca_password: secret
       vca_pubkey: pubkey
       vca_cacert: cacert
-      vca_apiproxy: apiproxy
       use_external_vca: false
       DATABASE_COMMONKEY: osm
     annotations:
index 85ec9c5..3ada8cb 100644 (file)
@@ -21,7 +21,7 @@ from charmhelpers.core.hookenv import (
     config,
 )
 from charms import layer
-
+import yaml
 
 @hook("upgrade-charm")
 @when("leadership.is_leader")
@@ -131,4 +131,7 @@ def make_pod_spec(ro_host, ro_port, kafka_host, kafka_port, mongo_uri):
     }
     data.update(cfg)
 
-    return pod_spec_template % data
+    spec = yaml.safe_dump(pod_spec_template % data)
+    if "vca_apiproxy" in cfg and cfg["vca_apiproxy"] != "":
+        spec["containers"][0]["config"]["OSMLCM_VCA_APIPROXY"] = cfg["vca_apiproxy"]
+    return spec
\ No newline at end of file
index 82a76e0..d8b51e7 100644 (file)
@@ -45,6 +45,5 @@ containers:
       OSMLCM_VCA_PUBKEY: %(vca_pubkey)s
       OSMLCM_VCA_SECRET: %(vca_password)s
       OSMLCM_VCA_CACERT: %(vca_cacert)s
-      OSMLCM_VCA_APIPROXY: %(vca_apiproxy)s
       OSMLCM_VCA_CLOUD: %(vca_cloud)s
       OSMLCM_VCA_K8S_CLOUD: %(vca_k8s_cloud)s