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

Lint fails on global output parameter in wft #13997

Open
3 of 4 tasks
Gilwyad opened this issue Dec 14, 2024 · 1 comment
Open
3 of 4 tasks

Lint fails on global output parameter in wft #13997

Gilwyad opened this issue Dec 14, 2024 · 1 comment

Comments

@Gilwyad
Copy link

Gilwyad commented Dec 14, 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?

argo lint fails on a workflow template that I am able to kubectl apply and is working in a workflow!

More details in the discussion #13870

Version(s)

v3.5.10

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: workflow-template-with-global-output-parameter-lint-fails
spec:
  templates:
    - name: test-one
      steps:
        - - name: hello-test-1
            template: hello1
          - name: hello-test-2
            template: hello2
            when: '{{workflow.outputs.parameters.variable}} == true'

    - name: hello1
      container:
        image: busybox
        command: [sh, -c]
        args: ["echo hello test 1"]

    - name: hello2
      container:
        image: busybox
        command: [sh, -c]
        args: ["echo hello test 2"]

Logs from the workflow controller

The bug is not in the workflow execution, but in `argo lint`.

Logs from in your workflow's wait container

The bug is not in the workflow execution, but in `argo lint`.
@shuangkun
Copy link
Member

Could you add a real global outputs parameter?

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: workflow-template-with-global-output-parameter-lint-fails
spec:
  templates:
    - name: test-one
      steps:
        - - name: hello-test-1
            template: hello1
          - name: hello-test-2
            template: hello2
            when: '{{workflow.outputs.parameters.variable}} == true'

    - name: hello1
      container:
        image: busybox
        command: [sh, -c]
        args: ["echo hello test 1"]
      outputs:
        parameters:
        - name: variable
          value: "test"
          globalName: variable

    - name: hello2
      container:
        image: busybox
        command: [sh, -c]
        args: ["echo hello test 2"]
13997 % argo template lint global-output.yaml
✔ no linting errors found!

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

No branches or pull requests

2 participants