Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only set ARGO_PROGRESS_FILE when needed. Partial fix for #13089 #13743

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions workflow/controller/workflowpod.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,16 @@ func (woc *wfOperationCtx) createWorkflowPod(ctx context.Context, nodeName strin
{Name: common.EnvVarNodeID, Value: nodeID},
{Name: common.EnvVarIncludeScriptOutput, Value: strconv.FormatBool(opts.includeScriptOutput)},
{Name: common.EnvVarDeadline, Value: woc.getDeadline(opts).Format(time.RFC3339)},
{Name: common.EnvVarProgressFile, Value: common.ArgoProgressPath},
}

// only set tick durations if progress is enabled. The EnvVarProgressFile is always set (user convenience) but the
// progress is only monitored if the tick durations are >0.
// only set tick durations/EnvVarProgressFile if progress is enabled.
// The progress is only monitored if the tick durations are >0.
if woc.controller.progressPatchTickDuration != 0 && woc.controller.progressFileTickDuration != 0 {
envVars = append(envVars,
apiv1.EnvVar{
Name: common.EnvVarProgressFile,
Value: common.ArgoProgressPath,
},
agilgur5 marked this conversation as resolved.
Show resolved Hide resolved
apiv1.EnvVar{
Name: common.EnvVarProgressPatchTickDuration,
Value: woc.controller.progressPatchTickDuration.String(),
Expand Down
8 changes: 4 additions & 4 deletions workflow/controller/workflowpod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1989,13 +1989,13 @@ func TestProgressEnvVars(t *testing.T) {
})
})

t.Run("setting patch tick duration to 0 disables self reporting progress but still exposes the ARGO_PROGRESS_FILE env var as a convenience.", func(t *testing.T) {
t.Run("setting patch tick duration to 0 disables self reporting progress.", func(t *testing.T) {
cancel, pod := setup(t, func(workflowController *WorkflowController) {
workflowController.progressPatchTickDuration = 0
})
defer cancel()

assert.Contains(t, pod.Spec.Containers[0].Env, apiv1.EnvVar{
assert.NotContains(t, pod.Spec.Containers[0].Env, apiv1.EnvVar{
Name: common.EnvVarProgressFile,
Value: common.ArgoProgressPath,
})
Expand All @@ -2009,13 +2009,13 @@ func TestProgressEnvVars(t *testing.T) {
})
})

t.Run("setting read file tick duration to 0 disables self reporting progress but still exposes the ARGO_PROGRESS_FILE env var as a convenience.", func(t *testing.T) {
t.Run("setting read file tick duration to 0 disables self reporting progress.", func(t *testing.T) {
cancel, pod := setup(t, func(workflowController *WorkflowController) {
workflowController.progressFileTickDuration = 0
})
defer cancel()

assert.Contains(t, pod.Spec.Containers[0].Env, apiv1.EnvVar{
assert.NotContains(t, pod.Spec.Containers[0].Env, apiv1.EnvVar{
Name: common.EnvVarProgressFile,
Value: common.ArgoProgressPath,
})
Expand Down
Loading