Skip to content

Commit

Permalink
Change k8s env values to string
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Feb 16, 2024
1 parent fc94e6b commit 3ef7f0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion IM/tosca/Tosca.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
9 changes: 8 additions & 1 deletion test/files/tosca_k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 3ef7f0a

Please sign in to comment.