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)