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

HTTP templates: the outputs always get overridden with result #13955

Open
3 of 4 tasks
anvmga opened this issue Nov 29, 2024 · 3 comments
Open
3 of 4 tasks

HTTP templates: the outputs always get overridden with result #13955

anvmga opened this issue Nov 29, 2024 · 3 comments
Labels
area/agent Argo Agent that runs for HTTP and Plugin templates area/templates/http type/feature Feature request

Comments

@anvmga
Copy link

anvmga commented Nov 29, 2024

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?

In Http templates, the output always gets overridden with result.

Below workflow only prints result only and not any other values passed. More details mentioned here #13950 (reply in thread)) #13953

Expected Output:
Received message: 103.158.255.79
URL: https://httpbin.org/get

Received Output:
Received message: {{steps.get.outputs.parameters.result}}
URL: {{steps.get.outputs.parameters.url}}

Version(s)

v3.6.0

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

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: http-output-parameters-
spec:
  entrypoint: main
  templates:
  - name: main
    steps:
    - - name: get
        template: http-get

    - - name: print
        template: print-message
        arguments:
          parameters:
          - name: message
            value: "{{steps.get.outputs.parameters.result}}"
          - name: url
            value: "{{steps.get.outputs.parameters.url}}"

  - name: http-get
    http:
      url: https://httpbin.org/get
    outputs:
      parameters:
      - name: result
        valueFrom:
          jsonPath: '{.origin}'
      - name: url
        value: "https://httpbin.org/get"

  - name: print-message
    inputs:
      parameters:
      - name: message
      - name: url
    script:
      image: alpine:3.7
      command: [sh, -c]
      source: |
        echo "Received message: {{inputs.parameters.message}}"
        echo "URL: {{inputs.parameters.url}}"

Logs from the workflow controller

kubectl logs -n argo deploy/workflow-controller | grep ${workflow}

Logs from in your workflow's wait container

kubectl logs -n argo -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded
@jswxstw jswxstw added type/feature Feature request area/templates/http area/agent Argo Agent that runs for HTTP and Plugin templates and removed type/bug labels Nov 29, 2024
@jswxstw
Copy link
Member

jswxstw commented Nov 29, 2024

outputs := wfv1.Outputs{Result: ptr.To(string(bodyBytes))}

HTTP template does not support setting outputs parameters, this issue should be considered a feature.

@MasonM
Copy link
Contributor

MasonM commented Nov 29, 2024

@jswxstw That's not documented anywhere AFAICT, and there's no warning or validation error when submitting the example workflow, so I'd consider this to be a bug.

@jswxstw
Copy link
Member

jswxstw commented Dec 2, 2024

@jswxstw That's not documented anywhere AFAICT, and there's no warning or validation error when submitting the example workflow, so I'd consider this to be a bug.

@MasonM Indeed, parameters are quite complex, as the fields within it are not applicable to all templates. The documentation provides some introduction, but it is not particularly clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent Argo Agent that runs for HTTP and Plugin templates area/templates/http type/feature Feature request
Projects
None yet
Development

No branches or pull requests

3 participants