kezhenxu94 commented on code in PR #15758:
URL: 
https://github.com/apache/dolphinscheduler/pull/15758#discussion_r1536709504


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/k8s/AbstractK8sTaskExecutor.java:
##########
@@ -36,7 +38,9 @@ public abstract class AbstractK8sTaskExecutor {
     protected AbstractK8sTaskExecutor(TaskExecutionContext taskRequest) {
         this.taskRequest = taskRequest;
         this.k8sUtils = new K8sUtils();
-        this.yaml = new Yaml();
+        this.yaml = new Yaml(new ClassFilterConstructor(new Class[]{
+                List.class
+        }));

Review Comment:
   Please also check this, nested non-primitive types should be added too



##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/loop/template/http/parser/HttpTaskDefinitionParser.java:
##########
@@ -60,9 +60,9 @@ public class HttpTaskDefinitionParser implements 
TaskDefinitionParser<HttpLoopTa
     }
 
     protected @NonNull LoopTaskYamlDefinition parseYamlConfigFile(@NonNull 
String yamlConfigFile) throws IOException {
-        Yaml yaml = new Yaml(new Constructor(LoopTaskYamlDefinition.class));
         try (FileReader fileReader = new FileReader(yamlConfigFile)) {
-            return yaml.load(fileReader);
+            return new Yaml(new ClassFilterConstructor(new 
Class[]{LoopTaskYamlDefinition.class}))

Review Comment:
   I think, you need to add all nested types(except for the primitive types in 
Java), such as 
   
   
https://github.com/apache/dolphinscheduler/blob/2e169076dc565f194c11ee4f55a4ac7f65071c6a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/loop/template/LoopTaskYamlDefinition.java#L29
   
   
https://github.com/apache/dolphinscheduler/blob/2e169076dc565f194c11ee4f55a4ac7f65071c6a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/loop/template/LoopTaskYamlDefinition.java#L36
   
   
   
https://github.com/apache/dolphinscheduler/blob/2e169076dc565f194c11ee4f55a4ac7f65071c6a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/loop/template/LoopTaskYamlDefinition.java#L42
   
   And so on……



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to