如何解决您可以在头盔测试模板文件中包括超时选项吗?
我知道从命令行执行helm test
时可以通过使用命令行上的--timeout
标志来更改超时选项。
有没有一种方法可以在模板文件中指定?
解决方法
如果将测试指定为Job
而不是Pod
,则可以通过设置JobSpec
字段在activeDeadlineSeconds
中指定截止日期。
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ include "helm-test-timeout.fullname" . }}-test-timeout"
labels:
{{ include "helm-test-timeout.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
activeDeadlineSeconds: 30
template:
spec:
containers:
# The nginx container will just launch and wait
# and cause the test to time out
- name: nginx
image: nginx
restartPolicy: Never
但是,不能使用--timeout
标志将helm test
延长此期限。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。