Skip to content

Commit

Permalink
Signed-off-by: tooptoop4 <[email protected]>
Browse files Browse the repository at this point in the history
  • Loading branch information
tooptoop4 authored Oct 19, 2024
1 parent e09d2f1 commit ba7d920
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions workflow/controller/workflowpod.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,26 @@ func (woc *wfOperationCtx) createWorkflowPod(ctx context.Context, nodeName strin
simplifiedTmpl.Inputs = wfv1.Inputs{
Artifacts: simplifiedTmpl.Inputs.Artifacts,
}

// simplify template by clearing useless volumemounts related to user configmaps ie somecode.py
if simplifiedTmpl.Container != nil && simplifiedTmpl.Container.VolumeMounts != nil {
var filteredVolumeMounts []v1.VolumeMount

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / Unit Tests

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: v1) (typecheck)

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: v1 (typecheck)

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / Windows Unit Tests

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / E2E Tests (test-plugins, plugins, false)

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / E2E Tests (test-cron, minimal, false)

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / E2E Tests (test-cli, mysql, true)

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / E2E Tests (test-executor, minimal, false)

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / E2E Tests (test-java-sdk, minimal, true)

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / E2E Tests (test-examples, minimal, false)

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / E2E Tests (test-functional, minimal, false)

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / E2E Tests (test-api, mysql, true)

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / E2E Tests (test-corefunctional, v1.28.13+k3s1, minimal, false)

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / E2E Tests (test-functional, v1.28.13+k3s1, minimal, false)

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / E2E Tests (test-corefunctional, minimal, false)

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / E2E Tests (test-executor, v1.28.13+k3s1, minimal, false)

undefined: v1

Check failure on line 307 in workflow/controller/workflowpod.go

View workflow job for this annotation

GitHub Actions / E2E Tests (test-python-sdk, minimal, true)

undefined: v1
for _, mnt := range simplifiedTmpl.Container.VolumeMounts {
isConfigMapVolume := false
for _, vol := range pod.Spec.Volumes {
if vol.Name == mnt.Name && vol.ConfigMap != nil && vol.Name != "argo-env-config" {
isConfigMapVolume = true
break
}
}
if isConfigMapVolume {
continue
}
filteredVolumeMounts = append(filteredVolumeMounts, mnt)
}
simplifiedTmpl.Container.VolumeMounts = filteredVolumeMounts
}

envVarTemplateValue := wfv1.MustMarshallJSON(simplifiedTmpl)

// Add standard environment variables, making pod spec larger
Expand Down

0 comments on commit ba7d920

Please sign in to comment.