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

Interpolating variables into multiple volume mounts in a WorkflowTemplate is broken #1842

Closed
jmeickle opened this issue Dec 12, 2019 · 3 comments · Fixed by #1844
Closed
Assignees
Labels

Comments

@jmeickle
Copy link

Is this a BUG REPORT or FEATURE REQUEST?:

Bug report

What happened:

[eronarn@ip-192-168-10-243 cohortrunner]$ argo template create workflows/algorunner-template.yml 2019/12/12 12:52:34 Failed to create workflow template: templates.cohortrunner-template templates.cohortrunner-template.container.volumeMounts[1].mountPath 'placeholder' already mounted in container.volumeMounts.qinit-mount

What you expected to happen:

Not that

How to reproduce it (as minimally and precisely as possible):

Create a WorkflowTemplate with multiple VolumeMounts on the same container, and use variables for their paths. Even if the variables are different, they all get interpolated as "placeholder". This then causes validation to fail.

Anything else we need to know?:

First mentioned in a comment here: #1312 (comment)

Environment:

  • Argo version:
[eronarn@ip-192-168-10-243 cohortrunner]$ argo version
argo: v2.4.3
  BuildDate: 2019-12-06T03:36:38Z
  GitCommit: cfe5f377bc3552fba90afe6db7a76edd92c753cd
  GitTreeState: clean
  GitTag: v2.4.3
  GoVersion: go1.11.5
  Compiler: gc
  Platform: darwin/amd64
  • Kubernetes version :
$ [eronarn@ip-192-168-10-243 cohortrunner]$ kubectl version -o yaml
clientVersion:
  buildDate: "2019-06-06T01:44:30Z"
  compiler: gc
  gitCommit: 5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0
  gitTreeState: clean
  gitVersion: v1.14.3
  goVersion: go1.12.5
  major: "1"
  minor: "14"
  platform: darwin/amd64
serverVersion:
  buildDate: "2019-11-13T11:11:50Z"
  compiler: gc
  gitCommit: 7015f71e75f670eb9e7ebd4b5749639d42e20079
  gitTreeState: clean
  gitVersion: v1.15.6
  goVersion: go1.12.12
  major: "1"
  minor: "15"
  platform: linux/amd64
@dtaniwaki dtaniwaki self-assigned this Dec 12, 2019
@dtaniwaki
Copy link
Member

@Eronarn Could you provide a reproducible manifest for this issue?

@dtaniwaki
Copy link
Member

I will try to fix the issue with the following manifest.

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  generateName: multi-volumes-mounts-
spec:
  templates:
  - name: multi-volume-mounts
    inputs:
      parameters:
      - name: foo
      - name: bar
    container:
      image: debian:latest
      volumeMounts:
      - name: workdir1
        mountPath: "{{inputs.parameters.foo}}"
      - name: workdir2
        mountPath: "{{inputs.parameters.bar}}"

@dtaniwaki
Copy link
Member

dtaniwaki commented Dec 13, 2019

I found a minimum manifest to reproduce this issue.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: issue1842-
spec:
  entrypoint: multi-volumemounts
  arguments:
    parameters:
    - name: foo
      value: /mnt/foo
    - name: bar
      value: /mnt/bar
  volumes:
  - name: workdir
    emptyDir: {}
  templates:
  - name: multi-volumemounts
    template: multi-volumemounts-inner
  - name: multi-volumemounts-inner
    inputs:
      parameters:
      - name: foo
      - name: bar
    container:
      image: debian:latest
      volumeMounts:
      - name: workdir
        mountPath: "{{inputs.parameters.foo}}"
      - name: workdir
        mountPath: "{{inputs.parameters.bar}}"

And sent a PR for the fix including a unit test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants