Skip to content

Commit

Permalink
response to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkPotato777 committed Sep 24, 2024
1 parent 9d14029 commit 53af87a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public static JobCaller buildProcessCaller(JobContext context) {
String jobContextFilePath = JobUtils.getExecutorDataPath() + "/" + StringUtils.uuid() + ".enc";
try {
FileUtils.writeStringToFile(new File(jobContextFilePath),
environments.get(JobEnvKeyConstants.ODC_JOB_CONTEXT),
JobUtils.encrypt(environments.get(JobEnvKeyConstants.ENCRYPT_KEY),
environments.get(JobEnvKeyConstants.ENCRYPT_SALT), JobUtils.toJson(context)),
Charset.defaultCharset());
} catch (Exception ex) {
FileUtils.deleteQuietly(new File(jobContextFilePath));
Expand All @@ -57,8 +58,6 @@ public static JobCaller buildProcessCaller(JobContext context) {
environments.put(JobEnvKeyConstants.ODC_JOB_CONTEXT_FILE_PATH,
JobUtils.encrypt(environments.get(JobEnvKeyConstants.ENCRYPT_KEY),
environments.get(JobEnvKeyConstants.ENCRYPT_SALT), jobContextFilePath));
// remove JobContext from environments
environments.remove(JobEnvKeyConstants.ODC_JOB_CONTEXT);
ProcessConfig config = new ProcessConfig();
config.setEnvironments(environments);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ public class JobEnvironmentFactory {
public Map<String, String> build(JobContext context, TaskRunMode runMode) {
putEnv(JobEnvKeyConstants.ODC_BOOT_MODE, () -> JobConstants.ODC_BOOT_MODE_EXECUTOR);
putEnv(JobEnvKeyConstants.ODC_TASK_RUN_MODE, runMode::name);
putEnv(JobEnvKeyConstants.ODC_JOB_CONTEXT, () -> JobUtils.toJson(context));

if (runMode.isK8s()) {
putEnv(JobEnvKeyConstants.ODC_JOB_CONTEXT, () -> JobUtils.toJson(context));
}
JobCredentialProvider jobCredentialProvider = JobConfigurationHolder.getJobConfiguration()
.getJobCredentialProvider();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.LoggerContext;
import org.eclipse.jgit.util.StringUtils;

import com.oceanbase.odc.common.trace.TaskContextHolder;
import com.oceanbase.odc.common.trace.TraceContextHolder;
import com.oceanbase.odc.common.util.StringUtils;
import com.oceanbase.odc.common.util.SystemUtils;
import com.oceanbase.odc.core.shared.Verify;
import com.oceanbase.odc.service.task.caller.JobContext;
Expand Down

0 comments on commit 53af87a

Please sign in to comment.