Skip to content

Commit bf7760a

Browse files
authored
feat: ARGO_TEMPLATE env var without inputs.parameters (#13742)
1 parent 948127c commit bf7760a

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

.spelling

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
5xx
2424
8Ki
2525
90m
26+
ARGO_TEMPLATE
2627
Alexandre
2728
Alibaba
2829
Ang
@@ -165,6 +166,7 @@ govaluate
165166
gzipped
166167
i.e.
167168
idempotence
169+
inputs.parameters
168170
instantiator
169171
instantiators
170172
jenkins

docs/environment-variables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This document outlines environment variables that can be used to customize behav
2323
| `ARGO_AGENT_CPU_LIMIT` | `resource.Quantity` | `100m` | CPU resource limit for the agent. |
2424
| `ARGO_AGENT_MEMORY_LIMIT` | `resource.Quantity` | `256m` | Memory resource limit for the agent. |
2525
| `ARGO_POD_STATUS_CAPTURE_FINALIZER` | `bool` | `false` | The finalizer blocks the deletion of pods until the controller captures their status.
26+
| `ARGO_TEMPLATE_WITH_INPUTS_PARAMETERS` | `bool` | `true` | Whether to keep inputs.parameters inside the ARGO_TEMPLATE environment variable of pods.
2627
| `BUBBLE_ENTRY_TEMPLATE_ERR` | `bool` | `true` | Whether to bubble up template errors to workflow. |
2728
| `CACHE_GC_PERIOD` | `time.Duration` | `0s` | How often to perform memoization cache GC, which is disabled by default and can be enabled by providing a non-zero duration. |
2829
| `CACHE_GC_AFTER_NOT_HIT_DURATION` | `time.Duration` | `30s` | When a memoization cache has not been hit after this duration, it will be deleted. |

workflow/controller/workflowpod.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,20 @@ func (woc *wfOperationCtx) createWorkflowPod(ctx context.Context, nodeName strin
297297
}
298298

299299
envVarTemplateValue := wfv1.MustMarshallJSON(tmpl)
300+
if os.Getenv("ARGO_TEMPLATE_WITH_INPUTS_PARAMETERS") == "false" {
301+
tmplWithoutInputs := tmpl.DeepCopy()
302+
// Preserve Inputs.Artifacts and clear other inputs
303+
var artifacts []wfv1.Artifact
304+
if len(tmplWithoutInputs.Inputs.Artifacts) > 0 {
305+
artifacts = tmplWithoutInputs.Inputs.Artifacts
306+
} else {
307+
artifacts = []wfv1.Artifact{}
308+
}
309+
tmplWithoutInputs.Inputs = wfv1.Inputs{
310+
Artifacts: artifacts,
311+
}
312+
envVarTemplateValue = wfv1.MustMarshallJSON(tmplWithoutInputs)
313+
}
300314

301315
// Add standard environment variables, making pod spec larger
302316
envVars := []apiv1.EnvVar{

0 commit comments

Comments
 (0)