From aa167a2bb58ec2164b922b420791200ef416e8fe Mon Sep 17 00:00:00 2001 From: MieAh <100568933+MieAh@users.noreply.github.com> Date: Wed, 25 Oct 2023 02:29:40 +0800 Subject: [PATCH] Add an initialization container for delayed exposure. --- .../dubbo/scenario/builder/ConfigurationImpl.java | 5 +++-- .../scenario/builder/vo/ServiceComponent.java | 14 +++----------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/test/dubbo-scenario-builder/src/main/java/org/apache/dubbo/scenario/builder/ConfigurationImpl.java b/test/dubbo-scenario-builder/src/main/java/org/apache/dubbo/scenario/builder/ConfigurationImpl.java index db271f6dbc..628209be65 100644 --- a/test/dubbo-scenario-builder/src/main/java/org/apache/dubbo/scenario/builder/ConfigurationImpl.java +++ b/test/dubbo-scenario-builder/src/main/java/org/apache/dubbo/scenario/builder/ConfigurationImpl.java @@ -727,8 +727,9 @@ private static KubernetesService getKubernetesService(ServiceComponent dependenc if(dependency.getInit() != null) { Yaml yaml = new Yaml(); - List> inits = (List>) dependency.getInit(); - for (Map initMap : inits) { + List inits = dependency.getInit(); + for (Object map : inits) { + Map initMap = (Map) map; InitContainer initContainer = new InitContainer(); Map newMap = new LinkedHashMap<>(); diff --git a/test/dubbo-scenario-builder/src/main/java/org/apache/dubbo/scenario/builder/vo/ServiceComponent.java b/test/dubbo-scenario-builder/src/main/java/org/apache/dubbo/scenario/builder/vo/ServiceComponent.java index 2e59beda0b..91479ca09b 100644 --- a/test/dubbo-scenario-builder/src/main/java/org/apache/dubbo/scenario/builder/vo/ServiceComponent.java +++ b/test/dubbo-scenario-builder/src/main/java/org/apache/dubbo/scenario/builder/vo/ServiceComponent.java @@ -42,9 +42,8 @@ public class ServiceComponent { private List depends_on; private Map healthcheck; - private Map init; + private List init; - private List initCommand; private List healthcheckExec; @@ -319,19 +318,12 @@ public void setVolumes(List volumes) { } - public Map getInit() { + public List getInit() { return init; } - public void setInit(Map init) { + public void setInit( List init) { this.init = init; } - public List getInitCommand() { - return initCommand; - } - - public void setInitCommand(List initCommand) { - this.initCommand = initCommand; - } }