chore: add offline linting (#5981)

* Added the offline linting

* update after feedback
This commit is contained in:
Niklas Hansson 2021-07-20 17:39:15 +02:00 committed by GitHub
parent 74d27e7e7e
commit 354e4251e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1151,7 +1151,7 @@ Please create a new issue at https://github.com/kubeflow/pipelines/issues attach
container:
image: docker/whalesay:latest""")
except:
warnings.warn("Cannot validate the compiled workflow. Found the argo program in PATH, but it's not usable. argo v2.4.3 should work.")
warnings.warn("Cannot validate the compiled workflow. Found the argo program in PATH, but it's not usable. argo CLI v3.1.1+ should work.")
if has_working_argo_lint:
_run_argo_lint(yaml_text)
@ -1163,7 +1163,7 @@ def _run_argo_lint(yaml_text: str):
import subprocess
argo_path = shutil.which('argo')
if argo_path:
result = subprocess.run([argo_path, 'lint', '/dev/stdin'], input=yaml_text.encode('utf-8'), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result = subprocess.run([argo_path, '--offline=true', 'lint', '/dev/stdin'], input=yaml_text.encode('utf-8'), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if result.returncode:
if re.match(
pattern=r'.+failed to resolve {{tasks\..+\.outputs\.artifacts\..+}}.+',