diff --git a/test/dubbo-scenario-builder/src/main/java/org/apache/dubbo/scenario/builder/kubernetes/KubernetesService.java b/test/dubbo-scenario-builder/src/main/java/org/apache/dubbo/scenario/builder/kubernetes/KubernetesService.java index 09cdac185b..1b68f136d3 100644 --- a/test/dubbo-scenario-builder/src/main/java/org/apache/dubbo/scenario/builder/kubernetes/KubernetesService.java +++ b/test/dubbo-scenario-builder/src/main/java/org/apache/dubbo/scenario/builder/kubernetes/KubernetesService.java @@ -43,6 +43,7 @@ public class KubernetesService { private Map environment; private Map init; + private List initCommand; public String getName() { diff --git a/test/dubbo-scenario-builder/src/main/resources/kubernetes-manifest.template b/test/dubbo-scenario-builder/src/main/resources/kubernetes-manifest.template index 200c6ad9a6..ce367aa72d 100644 --- a/test/dubbo-scenario-builder/src/main/resources/kubernetes-manifest.template +++ b/test/dubbo-scenario-builder/src/main/resources/kubernetes-manifest.template @@ -65,15 +65,20 @@ spec: spec: <#if service.init??> initContainers: + <#if service.init?has_key("name")> + <#assign nameValue = service.init.name> + <#assign _ = service.init.remove("name")> + - name: ${nameValue} + + <#list service.init as key,value> + ${key}: ${value} + <#if service.initCommand??> - command: + command: <#list service.initCommand as cmd> - - "${cmd}" + - "${cmd}" - <#list service.init as key,value> - ${key}: ${value} - containers: - name: ${service.name}