Add image_username and image_password to charms
This commit will allow us to pull images for OSM components from a
private docker registry, protected with username and password
Change-Id: I854028d6abbb1cae07c61692ba73d08825763212
Signed-off-by: David Garcia <david.garcia@canonical.com>
diff --git a/installers/charm/pla/src/charm.py b/installers/charm/pla/src/charm.py
index 785766d..16e7303 100755
--- a/installers/charm/pla/src/charm.py
+++ b/installers/charm/pla/src/charm.py
@@ -29,9 +29,6 @@
)
-sys.path.append("lib")
-
-
logger = logging.getLogger(__name__)
@@ -85,7 +82,11 @@
config = self.framework.model.config
ports = [
- {"name": "port", "containerPort": config["port"], "protocol": "TCP", },
+ {
+ "name": "port",
+ "containerPort": config["port"],
+ "protocol": "TCP",
+ },
]
config_spec = {
@@ -103,7 +104,11 @@
"containers": [
{
"name": self.framework.model.app.name,
- "image": config["image"],
+ "imageDetails": {
+ "imagePath": config["image"],
+ "username": config["image_username"],
+ "password": config["image_password"],
+ },
"ports": ports,
"config": config_spec,
}
@@ -136,9 +141,7 @@
self._apply_spec()
def on_mongo_relation_changed(self, event):
- mongodb_uri = event.relation.data[event.unit].get(
- "connection_string"
- )
+ mongodb_uri = event.relation.data[event.unit].get("connection_string")
if mongodb_uri and self.state.mongodb_uri != mongodb_uri:
self.state.mongodb_uri = mongodb_uri
self._apply_spec()