From 3ef7f0a2862e576e3ff48638f0b9629fa77fc84b Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Fri, 16 Feb 2024 13:53:17 +0100 Subject: [PATCH] Change k8s env values to string --- IM/tosca/Tosca.py | 2 +- test/files/tosca_k8s.yml | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/IM/tosca/Tosca.py b/IM/tosca/Tosca.py index 139c0f2d..0c55889a 100644 --- a/IM/tosca/Tosca.py +++ b/IM/tosca/Tosca.py @@ -2156,7 +2156,7 @@ def _gen_k8s_system(self, node, nodetemplates): raise Exception("Only one artifact is supported for K8s container.") artifact = list(artifacts.values())[0] - image = artifact.get("file", None) + image = self._final_function_result(artifact.get("file", None), node) if not image: raise Exception("No image specified for K8s container.") if "tosca.artifacts.Deployment.Image.Container.Docker" != artifact.get("type", None): diff --git a/test/files/tosca_k8s.yml b/test/files/tosca_k8s.yml index b7d191f0..48f57227 100644 --- a/test/files/tosca_k8s.yml +++ b/test/files/tosca_k8s.yml @@ -11,6 +11,13 @@ repositories: topology_template: + inputs: + + image: + type: string + description: The image to be used in the container + default: "mysql:5.7" + node_templates: # The MYSQL container based on official MySQL image in Docker hub @@ -23,7 +30,7 @@ topology_template: - host: mysql_runtime artifacts: my_image: - file: "mysql:5.7" + file: { get_input: image } type: tosca.artifacts.Deployment.Image.Container.Docker repository: docker_hub