Skip to content

HTTP Template: Can't use parameter for timeoutSeconds #15024

@joarobles

Description

@joarobles

Hello,

I am trying to use a parameter for the timeoutSeconds attribute of the HTTP template

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: api-call
spec:
  entrypoint: main
  templates:
    - name: main
      inputs:
        parameters:
          - name: url
          - name: method
          - name: timeoutSeconds
            default: 1800 # 30 min * 60s
      http:
        timeoutSeconds: '{{= asInt(inputs.parameters.timeoutSeconds) }}'
        url: '{{ inputs.parameters.url }}'
        method: '{{ inputs.parameters.method }}'

Unfortunately when deploying such a resource, I am getting the following error in Argo Workflows UI:

json: cannot unmarshal string into Go struct field HTTP.items.spec.templates.http.timeoutSeconds of type int64

The problem is, that I need the quotes around the Go template that resolves the parameter - but in turn they set the datatype to string causing deserialization to fail.

Has anyone a suggestion on how I can fix / work around this?

Originally posted by @atetzner in #13083

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions