chore: add offline linting (#5981)
* Added the offline linting * update after feedback
This commit is contained in:
parent
74d27e7e7e
commit
354e4251e8
|
|
@ -1151,7 +1151,7 @@ Please create a new issue at https://github.com/kubeflow/pipelines/issues attach
|
||||||
container:
|
container:
|
||||||
image: docker/whalesay:latest""")
|
image: docker/whalesay:latest""")
|
||||||
except:
|
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:
|
if has_working_argo_lint:
|
||||||
_run_argo_lint(yaml_text)
|
_run_argo_lint(yaml_text)
|
||||||
|
|
@ -1163,7 +1163,7 @@ def _run_argo_lint(yaml_text: str):
|
||||||
import subprocess
|
import subprocess
|
||||||
argo_path = shutil.which('argo')
|
argo_path = shutil.which('argo')
|
||||||
if argo_path:
|
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 result.returncode:
|
||||||
if re.match(
|
if re.match(
|
||||||
pattern=r'.+failed to resolve {{tasks\..+\.outputs\.artifacts\..+}}.+',
|
pattern=r'.+failed to resolve {{tasks\..+\.outputs\.artifacts\..+}}.+',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue