遇到问题--Kubernetes--argo--output does not exist

情况

在使用argo进行流程串联时 使用了output进行文件输出。

在生产环境的argo中运行,即时需要output的文件在pod中不存在,也能正常运行 进入后续步骤。

但是内测环境的argo 同样的情况下会报错。

报错如下:

path /mendel/need_update_barcode.txt does not exist (or /mendel/need_update_barcode.txt is empty) in archive /argo/outputs/artifacts/need-update-barcode.tgz

原因

经过对比,生产环境和内测环境的流程 唯一的区别就是 argo的版本不同

老版本的argo output 文件不存在时会继续运行,成功退出。

这个属性被当成bug修复了。 原因时 为了保证每个输出都有后续的明确的用途。

2.3 和2.4 版本支持optional属性,可以选择 是否检测 文件不存在的情况, 可以忽略 不存在的情况。

参考链接:

https://github.com/argoproj/argo/issues/1472

https://github.com/argoproj/argo/pull/1277

https://github.com/argoproj/argo/issues/897

解决方法

如果我们期望 文件不存在或者文件大小为0 时 不报错,则将 该 output输出 设置为 可选 optional为 true。 则 argo不会检查 文件是否存在。

outputs:
  artifacts:
  - name: hello
    path: /hello.json
    optional: true

猜你喜欢

转载自blog.csdn.net/q383965374/article/details/103296783