From 74784a430c8874d0ae5180b1aecdf5ad1c981367 Mon Sep 17 00:00:00 2001 From: YannC Date: Wed, 5 Jun 2024 17:27:44 +0200 Subject: [PATCH] fix(): handle namespace variable in eval --- .../kestra/webserver/controllers/ExecutionController.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webserver/src/main/java/io/kestra/webserver/controllers/ExecutionController.java b/webserver/src/main/java/io/kestra/webserver/controllers/ExecutionController.java index 0e111bab99..cc7efe79dc 100644 --- a/webserver/src/main/java/io/kestra/webserver/controllers/ExecutionController.java +++ b/webserver/src/main/java/io/kestra/webserver/controllers/ExecutionController.java @@ -247,11 +247,9 @@ public EvalResult eval( Task task = flow.findTaskByTaskId(taskRun.getTaskId()); - RunContext runContext = runContextFactory.of(flow, task, execution, taskRun, false); - try { return EvalResult.builder() - .result(runContext.render(expression)) + .result(runContextRender(flow, task, execution, taskRun, expression)) .build(); } catch (IllegalVariableEvaluationException e) { return EvalResult.builder() @@ -261,6 +259,10 @@ public EvalResult eval( } } + protected String runContextRender(Flow flow, Task task, Execution execution, TaskRun taskRun, String expression) throws IllegalVariableEvaluationException { + return runContextFactory.of(flow, task, execution, taskRun, false).render(expression); + } + @SuperBuilder @Getter @NoArgsConstructor