From 1136698fec200e1e7da193e33f5a78773e980c7b Mon Sep 17 00:00:00 2001 From: micafer Date: Tue, 6 Sep 2022 12:38:18 +0200 Subject: [PATCH 1/2] change codemeta --- codemeta.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codemeta.json b/codemeta.json index 446f1fea4..743f5d361 100644 --- a/codemeta.json +++ b/codemeta.json @@ -6,7 +6,7 @@ "@type": "SoftwareSourceCode", "identifier": "im", "name": "Infrastructure Manager", - "version": "1.11.0", + "version": "1.11.1", "description": "IM is a tool that deploys complex and customized virtual infrastructures on IaaS Cloud deployments", "license": "GNU General Public License v3.0", "author": [ From f0ac749f7ca0eb6064da3c050b3cf6f368835bb8 Mon Sep 17 00:00:00 2001 From: micafer Date: Wed, 7 Sep 2022 17:27:44 +0200 Subject: [PATCH 2/2] Add image_pull_secrets oscar property --- IM/connectors/OSCAR.py | 5 +++++ IM/tosca/Tosca.py | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/IM/connectors/OSCAR.py b/IM/connectors/OSCAR.py index 38461cd64..2cbe2347b 100644 --- a/IM/connectors/OSCAR.py +++ b/IM/connectors/OSCAR.py @@ -91,6 +91,11 @@ def _get_service_json(self, radl_system): service["script"] = radl_system.getValue("script") if radl_system.getValue("alpine"): service["alpine"] = True + if radl_system.getValue("image_pull_secrets"): + secrets = radl_system.getValue("image_pull_secrets") + if not isinstance(secrets, list): + secrets = [secrets] + service["image_pull_secrets"] = secrets if radl_system.getValue("disk.0.image.url"): url_image = urlparse(radl_system.getValue("disk.0.image.url")) diff --git a/IM/tosca/Tosca.py b/IM/tosca/Tosca.py index 283abfc27..36cb22175 100644 --- a/IM/tosca/Tosca.py +++ b/IM/tosca/Tosca.py @@ -1893,7 +1893,8 @@ def _gen_oscar_system(self, node): 'name': 'name', 'cpu': 'cpu.count', 'image': 'disk.0.image.url', - 'script': 'script' + 'script': 'script', + 'image_pull_secrets': 'image_pull_secrets' } for prop in node.get_properties_objects(): @@ -1965,6 +1966,10 @@ def _get_oscar_service_json(self, node): res["image"] = value elif prop.name == 'env_variables': res['environment'] = {'Variables': value} + elif prop.name == 'image_pull_secrets': + if not isinstance(value, list): + value = [value] + res['image_pull_secrets'] = value else: # this should never happen Tosca.logger.warn("Property %s not expected. Ignoring." % prop.name)