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

Passing an output parameter from a template into a templateRef input fails with a failed to resolve error. #14125

Open
3 of 4 tasks
Jamozed opened this issue Jan 26, 2025 · 1 comment
Labels

Comments

@Jamozed
Copy link

Jamozed commented Jan 26, 2025

Pre-requisites

  • I have double-checked my configuration
  • I have tested with the :latest image tag (i.e. quay.io/argoproj/workflow-controller:latest) and can confirm the issue still exists on :latest. If not, I have explained why, in detail, in my description below.
  • I have searched existing issues and could not find a match for this bug
  • I'd like to contribute the fix myself (see contributing guide)

What happened? What did you expect to happen?

Passing an output parameter from a template into a templateRef input argument fails with Bad Request: templates.main.steps[1].debug templates.debug: failed to resolve {{steps.generate-volume.outputs.parameters.pvc-name}}.

The supposedly invalid template used to work, and works when the templateRef is replaced with a template from the same file. It also worked briefly on retry when it initially stopped working (perhaps we were still running an old version of the web UI, if that is relevant), but on latest a workflow doesn't even get created before it fails.

Version(s)

86e51da260cf08708ef1debcb8af6bb373c93492635ce74c434f1012de58af08

Paste a minimal workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflow that uses private images.

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: outer
spec:
  entrypoint: main
  templates:
    - name: main
      steps:
        - - name: generate-volume
            template: generate-volume
        - - name: debug
            templateRef:
              name: inner
              template: debug
            arguments:
              parameters:
                - name: pvc-name
                  value: "{{steps.generate-volume.outputs.parameters.pvc-name}}"

    - name: generate-volume
      resource:
        action: create
        setOwnerReference: true
        manifest: |
          apiVersion: v1
          kind: PersistentVolumeClaim
          metadata:
            generateName: asset-volume-
          spec:
            accessModes: ["ReadWriteOnce"]
            resources:
              requests:
                storage: 1Ti
      outputs:
        parameters:
          - name: pvc-name
            valueFrom:
              jsonPath: "{.metadata.name}"
---
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: inner
spec:
  templates:
    - name: debug
      inputs:
        parameters:
          - name: pvc-name
      container:
        image: busybox
        command: ["echo"]
        args:
          - "{{inputs.parameters.pvc-name}}"
        resources:
        volumeMounts:
          - name: asset-volume
            mountPath: /working
      volumes:
        - name: asset-volume
          persistentVolumeClaim:
            claimName: "{{inputs.parameters.pvc-name}}"

Logs from the workflow controller

N/A workflow cannot be created.

Logs from in your workflow's wait container

N/A workflow cannot be created.
@agrfj
Copy link

agrfj commented Feb 13, 2025

I came across the same issue, it seems that if you remove prefix {{ and postfix }} in arguments value string, template is accepted and executed successfully.

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

No branches or pull requests

2 participants