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 f46dbaa commit 81786e3
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions workflow/controller/workflowpod.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,21 +304,21 @@ func (woc *wfOperationCtx) createWorkflowPod(ctx context.Context, nodeName strin

// simplify template by clearing useless volumemounts related to user configmaps ie somecode.py
if simplifiedTmpl.Container != nil && simplifiedTmpl.Container.VolumeMounts != nil {
var filteredVolumeMounts []apiv1.VolumeMount
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
var filteredVolumeMounts []apiv1.VolumeMount
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)
Expand Down

0 comments on commit 81786e3

Please sign in to comment.