Add switch for checkOwn (#197) (#12803)

This commit is contained in:
Wenjun Ruan 2022-11-08 10:44:17 +08:00 committed by GitHub
parent 145c5ac8cb
commit fe3e93861f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 1 deletions

View File

@ -137,6 +137,8 @@ public final class Constants {
*/
public static final String SUDO_ENABLE = "sudo.enable";
public static final String SET_TASK_DIR_TO_TENANT_ENABLE = "setTaskDirToTenant.enable";
/**
* resource storage type
*/

View File

@ -96,6 +96,7 @@ support.hive.oneSession=false
# use sudo or not, if set true, executing user is tenant user and deploy user needs sudo permissions; if set false, executing user is the deploy user and doesn't need sudo permissions
sudo.enable=true
setTaskDirToTenant.enable=false
# network interface preferred like eth0, default: empty
#dolphin.scheduler.network.interface.preferred=

View File

@ -73,6 +73,10 @@ public class CommonUtils {
return PropertyUtils.getBoolean(Constants.DEVELOPMENT_STATE, true);
}
public static boolean isSetTaskDirToTenantEnable() {
return PropertyUtils.getBoolean(Constants.SET_TASK_DIR_TO_TENANT_ENABLE, false);
}
/**
* if upload resource is HDFS and kerberos startup is true , else false
*

View File

@ -145,7 +145,7 @@ public class TaskExecutionCheckerUtils {
}
try {
Files.createDirectories(filePath);
if (!OSUtils.isSudoEnable()) {
if (!CommonUtils.isSetTaskDirToTenantEnable()) {
// we need to open sudo, then we can change the owner.
return;
}