我有一个基于kubernetes网站示例的工作定义.
apiVersion: batch/v1
kind: Job
metadata:
name: pi-with-timeout-6
spec:
activeDeadlineSeconds: 30
completions: 1
paralleism: 1
template:
metadata:
name: pi
spec:
containers:
- name: pi
image: perl
command: ["exit", "1"]
restartPolicy: Never
Run Code Online (Sandbox Code Playgroud)
我想运行一次这个工作,如果失败则不重启.使用comand退出1 kubernetes尝试运行新pod以获取exit 0代码,直到达到activeDeadlineSeconds超时.怎么可以避免呢?我想在kubernetes中运行构建命令来检查编译,如果编译失败,我将得到不同于0的退出代码.我不想再次运行编译.
可能吗?怎么样?
如何将git存储库镜像到Gerrit?
我会做的:
[git repository for libdrm] - >我的gerrit < - >开发人员
Gerrit从freedesktop git存储库下载更改.开发人员从gerrit克隆存储库并推入gerrit.开发人员从不将更改推送到主存储库.
我用gerrit创建了新项目.我下载了存储库:
git clone http://anongit.freedesktop.org/git/mesa/drm.git
Run Code Online (Sandbox Code Playgroud)
我会把这个存储库推到gerrit,但我不能,因为我有错误:
remote: ERROR: In commit ced219ebbd3b266ac8326223bad62f994907ae6b
remote: ERROR: committer email address chris@chris-wilson.co.uk
remote: ERROR: does not match your user account.
remote: ERROR:
remote: ERROR: The following addresses are currently registered:
remote: ERROR: xxx@example.com
remote: ERROR:
remote: ERROR: To register an email address, please visit:
remote: ERROR: http://mygerrit-server/#/settings/contact
Run Code Online (Sandbox Code Playgroud)
我有所有人的权利.我怎么能把镜子添加到gerrit?
我使用rails和haml,haml-rails.
我如何在haml中创建hidden_field?
我有领域:
.field
= f.label :submit_date
= f.datetime_select :submit_date
Run Code Online (Sandbox Code Playgroud)
我会隐藏这个字段.用户无法手动修改日期时间.我将在创建对象时存储在db datetime中.我完全不知道怎么做.我知道如何在erb中做到这一点,但我会使用haml.
我需要将输出重定向到文件并添加日期时间.我试试这个:
make all | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; }' > file
Run Code Online (Sandbox Code Playgroud)
我预计:
2011-12-13 15:00:50 compilation....
2011-12-13 15:00:52 still compilation
2011-12-13 15:00:55 compilation
...
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?如果我在屏幕上删除">文件",我看到正确的输出.但我会将其重定向到文件.
有谁能够帮我?