argo-workflows: argo lint fails with "invalid configuration: no configuration has been provided"

Repro steps:

Checklist:

  • I’ve included the version.
  • I’ve included reproduction steps.
  • I’ve included the workflow YAML.
  • I’ve included the logs.

What happened:

argo lint workflow.yaml used to work in Argo v2.3.0, but it no longer works in Argo v.2.7.4

Error: time=“2020-04-21T01:50:18Z” level=fatal msg=“invalid configuration: no configuration has been provided”

What you expected to happen:

I expect argo lint to validate my workflow

How to reproduce it (as minimally and precisely as possible):

Download Argo CLI to some hermetic environment (e.g. Docker container under build). Try running argo lint workflow.yaml. Get error.

Anything else we need to know?:

I think argo lint might be trying to create Kubernetes client even though it’s not needed for linting.

Environment:

  • Argo version:
v2.7.4

Message from the maintainers:

If you are impacted by this bug please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 15
  • Comments: 38 (31 by maintainers)

Commits related to this issue

Most upvoted comments

This is still a PROBLEM. Running an argo server is not acceptable for something that’s supposed to be linting. It’s not a unit test. It’s not a dry run. It’s not supposed to know if the parameters are passed in right. It’s not supposed to know about other workflows and whether or not they exist.

It just needs to lint it and make sure that no one did something like:

inputs:
  parameters:
     parameters:
     ...

(real live example that I’m trying to stop from ever happening again)

This is what everyone is asking for. Not a “would this work if I launched it now?” but “did I screw up my yaml on accident?” or “did I misinterpret the docs at some point?”

Is it possible to lint templates offline?

$ argo --offline template lint
FATA[2022-06-03T12:18:45.892Z] Not implemented for offline client, only valid for kind '--kinds=workflows'

Unfortunately, I’m not sure we can acceptably fix this. In v2.5.2 we introduced workflow templates. To lint a workflow that contains a template, we must read the template from the cluster, so we must have a connection to the cluster. This means a hermetically sealed container cannot lint workflows that contain templates.

I’m experiencing the same issue inside a dockerfile which run argo version is it also mandatory that argo will have a connection for using the version command?