Skip to content

Argo cli 3.7.x crashes when linting manifest with empty array in steps and wrong template name reference #14861

@ktns

Description

@ktns

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?

Hello. After upgrading the CLI to versions 3.7.1 and 3.7.2, I encountered an issue where argo lint crashes with the following error:

panic: runtime error: invalid memory address or nil pointer dereference                                                                                                                                                                                                                                                       

After some investigation, I identified the root cause: an empty array in the steps template and an incorrectly referenced template name. It seems that no matter this misreference occurs in the entrypoint field or the steps template, it causes the problem.

When I downgraded to version 3.6.11, it correctly identified the undefined template name. (To my surprise, it didn't report any errors regarding the empty array. Is this by design?)

Version(s)

3.7.1, 3.7.2

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: Workflow
metadata:
  generateName: empty-array-in-steps
spec:
  podMetadata:
    labels:
      test: empty-array-in-steps
  podPriorityClassName: lowest
  entrypoint: steps-with-empty-array
  templates:
    - name: steps-with-empty-array
      steps:
        - [{name: steps1, template: steps-with-misreference}]
        - []
        - [{name: steps2, template: steps-with-misreference}]
    - name: steps-with-misreference
      steps:
        - [{name: hello1, template: hello}]
        - [{name: hello2, template: hell0}]
    - name: hello
      container:
        command: ['/bin/sh', '-c']
        args:
          - 'echo hello'
        image: 'busybox'
        name: hello

Logs from the workflow controller

n/a

Logs from in your workflow's wait container

n/a

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions