Browse Source

Add tenantCode propagation to DynamicCommandUtils.createCommand (#15956)

3.2.2-release-bak
刘阳阳(liuyangyang) 7 months ago committed by GitHub
parent
commit
ba5de75829
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/dynamic/DynamicCommandUtils.java
  2. 2
      dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/runner/task/dynamic/DynamicCommandUtilsTest.java

1
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/dynamic/DynamicCommandUtils.java

@ -65,6 +65,7 @@ public class DynamicCommandUtils {
command.setProcessInstancePriority(processInstance.getProcessInstancePriority());
command.setWorkerGroup(processInstance.getWorkerGroup());
command.setDryRun(processInstance.getDryRun());
command.setTenantCode(processInstance.getTenantCode());
return command;
}

2
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/runner/task/dynamic/DynamicCommandUtilsTest.java

@ -54,6 +54,7 @@ class DynamicCommandUtilsTest {
processInstance.setWarningGroupId(1);
processInstance.setProcessInstancePriority(null); // update this
processInstance.setWorkerGroup("worker");
processInstance.setTenantCode("unit-root");
processInstance.setDryRun(0);
}
@ -73,6 +74,7 @@ class DynamicCommandUtilsTest {
Assertions.assertEquals(processInstance.getProcessInstancePriority(), command.getProcessInstancePriority());
Assertions.assertEquals(processInstance.getWorkerGroup(), command.getWorkerGroup());
Assertions.assertEquals(processInstance.getDryRun(), command.getDryRun());
Assertions.assertEquals(processInstance.getTenantCode(), command.getTenantCode());
}
@Test

Loading…
Cancel
Save