From fa0eb467a874be8400ece474f8e09c478bd00fc3 Mon Sep 17 00:00:00 2001 From: zyfjrx <134594723+zyfjrx@users.noreply.github.com> Date: Wed, 12 Jul 2023 09:06:19 +0800 Subject: [PATCH] cherry-pick [Bug] [Seatunnel-Task] Run Mode defaults to run, and you cannot select a null value #14267 --- .../task/seatunnel/flink/SeatunnelFlinkParameters.java | 1 + .../plugin/task/seatunnel/flink/SeatunnelFlinkTask.java | 8 +++++++- .../task/components/node/fields/use-sea-tunnel.ts | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-seatunnel/src/main/java/org/apache/dolphinscheduler/plugin/task/seatunnel/flink/SeatunnelFlinkParameters.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-seatunnel/src/main/java/org/apache/dolphinscheduler/plugin/task/seatunnel/flink/SeatunnelFlinkParameters.java index 1d85ea0267..0c4bf34046 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-seatunnel/src/main/java/org/apache/dolphinscheduler/plugin/task/seatunnel/flink/SeatunnelFlinkParameters.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-seatunnel/src/main/java/org/apache/dolphinscheduler/plugin/task/seatunnel/flink/SeatunnelFlinkParameters.java @@ -35,6 +35,7 @@ public class SeatunnelFlinkParameters extends SeatunnelParameters { @Getter public enum RunModeEnum { + NONE("none"), RUN("--run-mode run"), RUN_APPLICATION("--run-mode run-application"); diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-seatunnel/src/main/java/org/apache/dolphinscheduler/plugin/task/seatunnel/flink/SeatunnelFlinkTask.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-seatunnel/src/main/java/org/apache/dolphinscheduler/plugin/task/seatunnel/flink/SeatunnelFlinkTask.java index 9d8b31a335..b4311aae71 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-seatunnel/src/main/java/org/apache/dolphinscheduler/plugin/task/seatunnel/flink/SeatunnelFlinkTask.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-seatunnel/src/main/java/org/apache/dolphinscheduler/plugin/task/seatunnel/flink/SeatunnelFlinkTask.java @@ -43,7 +43,13 @@ public class SeatunnelFlinkTask extends SeatunnelTask { @Override public List buildOptions() throws Exception { List args = super.buildOptions(); - args.add(Objects.isNull(seatunnelParameters.getRunMode()) ? SeatunnelFlinkParameters.RunModeEnum.RUN.getCommand() : seatunnelParameters.getRunMode().getCommand()); + if (!(Objects.isNull(seatunnelParameters.getRunMode()) + && SeatunnelFlinkParameters.RunModeEnum.NONE.equals(seatunnelParameters.getRunMode()))) { + args.add( + Objects.isNull(seatunnelParameters.getRunMode()) + ? SeatunnelFlinkParameters.RunModeEnum.RUN.getCommand() + : seatunnelParameters.getRunMode().getCommand()); + } if (StringUtils.isNotBlank(seatunnelParameters.getOthers())) { args.add(seatunnelParameters.getOthers()); } diff --git a/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sea-tunnel.ts b/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sea-tunnel.ts index 3f31422596..56b2a3cd6b 100644 --- a/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sea-tunnel.ts +++ b/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sea-tunnel.ts @@ -180,6 +180,10 @@ export const STARTUP_SCRIPT = [ ] export const FLINK_RUN_MODE = [ + { + label: 'none', + value: 'NONE' + }, { label: 'run', value: 'RUN'