Skip to content

Commit e10afe4

Browse files
authored
Merge pull request #915 from kerogers-cloudbees/JENKINS-57841
2 parents 7b40111 + a9d98ce commit e10afe4

File tree

9 files changed

+31
-22
lines changed

9 files changed

+31
-22
lines changed

examples/kaniko-declarative.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ spec:
2424
image: gcr.io/kaniko-project/executor:debug-539ddefcae3fd6b411a95982a830d987f4214251
2525
imagePullPolicy: Always
2626
command:
27-
- /busybox/cat
28-
tty: true
27+
- sleep
28+
args:
29+
- 9999999
2930
volumeMounts:
3031
- name: jenkins-docker-cfg
3132
mountPath: /kaniko/.docker

examples/kaniko-gcr.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ spec:
1616
image: gcr.io/kaniko-project/executor:debug
1717
imagePullPolicy: Always
1818
command:
19-
- /busybox/cat
20-
tty: true
19+
- sleep
20+
args:
21+
- 9999999
2122
volumeMounts:
2223
- name: kaniko-secret
2324
mountPath: /secret

examples/multi-container.groovy

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ spec:
99
containers:
1010
- name: maven
1111
image: maven:3.3.9-jdk-8-alpine
12-
command: ['cat']
13-
tty: true
12+
command:
13+
- sleep
14+
args:
15+
- 9999999
1416
- name: golang
1517
image: golang:1.8.0
16-
command: ['cat']
17-
tty: true
18+
command:
19+
- sleep
20+
args:
21+
- 9999999
1822
"""
1923
) {
2024

examples/openshift-home-yaml.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ spec:
1818
value: /home/jenkins
1919
- name: maven
2020
image: maven:3.6.3-jdk-8
21-
command: ['cat']
22-
tty: true
21+
command: ['sleep']
22+
args: ['9999999']
2323
volumeMounts:
2424
- name: home-volume
2525
mountPath: /home/jenkins

examples/selenium.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ spec:
1010
containers:
1111
- name: maven-firefox
1212
image: maven:3.3.9-jdk-8-alpine
13-
command: ['cat']
14-
tty: true
13+
command: ['sleep']
14+
args: ['9999999']
1515
- name: maven-chrome
1616
image: maven:3.3.9-jdk-8-alpine
17-
command: ['cat']
18-
tty: true
17+
command: ['sleep']
18+
args: ['9999999']
1919
- name: selenium-hub
2020
image: selenium/hub:3.4.0
2121
- name: selenium-chrome

src/main/resources/org/csanchez/jenkins/plugins/kubernetes/ContainerTemplate/config.jelly

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
</f:entry>
2424

2525
<f:entry field="command" title="${%Command to run}">
26-
<f:textbox default="/bin/sh -c"/>
26+
<f:textbox default="sleep"/>
2727
</f:entry>
2828

2929
<f:entry field="args" title="${%Arguments to pass to the command}">
30-
<f:textbox default="cat"/>
30+
<f:textbox default="9999999"/>
3131
</f:entry>
3232

3333
<f:entry field="ttyEnabled" title="${%Allocate pseudo-TTY}">
34-
<f:checkbox default="true"/>
34+
<f:checkbox default="talse"/>
3535
</f:entry>
3636

3737
<f:entry title="${%Environment Variables}" field="envVars" description="${%List of environment variables to set in agent pod}">
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
Arguments to pass to the command.
2-
${computer.jnlpmac} and ${computer.name} are replaced with the agent secret and name respectively.
1+
<p>Arguments to pass to the command.</p>
2+
<p><code>${computer.jnlpmac}</code> and <code>${computer.name}</code> are replaced with the agent secret and name respectively.</p>
3+
<p>For Windows containers the args <code>Start-Sleep 999999</code> are reasonable choices to go with <code>powershell</code>.</p>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
Override the image entrypoint with a different one
1+
<p>Override the image entrypoint with a different one.</p>
2+
<p>For Windows containers <code>powershell</code> is a good default.</p>
3+

src/test/resources/org/csanchez/jenkins/plugins/kubernetes/pipeline/declarative.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ pipeline {
55
containerTemplate {
66
name 'maven'
77
image 'maven:3.3.9-jdk-8-alpine'
8-
ttyEnabled true
9-
command 'cat'
8+
command 'sleep'
9+
args '9999999'
1010
}
1111
podRetention onFailure()
1212
}

0 commit comments

Comments
 (0)