Skip to content

Commit 442524f

Browse files
authored
Merge pull request #1275 from jglick/bumps
2 parents fe126b5 + a8b1ec0 commit 442524f

File tree

23 files changed

+81
-190
lines changed

23 files changed

+81
-190
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ updates:
55
schedule:
66
interval: daily
77
open-pull-requests-limit: 10
8-
ignore:
9-
- dependency-name: org.apache.commons:commons-lang3
10-
versions:
11-
- "> 3.8.1"
128
- package-ecosystem: docker
139
directory: '/src/main/resources/org/csanchez/jenkins/plugins/kubernetes'
10+
# TODO https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#ignore as needed to accept only *-jdk11
1411
schedule:
1512
interval: 'daily'
1613
- package-ecosystem: github-actions

README.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Find more examples in the [examples dir](examples).
151151
The default jnlp agent image used can be customized by adding it to the template
152152

153153
```groovy
154-
containerTemplate(name: 'jnlp', image: 'jenkins/inbound-agent:4.7-1', args: '${computer.jnlpmac} ${computer.name}'),
154+
containerTemplate(name: 'jnlp', image: 'jenkins/inbound-agent', args: '${computer.jnlpmac} ${computer.name}'),
155155
```
156156

157157
or with the yaml syntax. Pretty much any field from the [pod model](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/) can be specified through the yaml syntax.
@@ -162,7 +162,7 @@ kind: Pod
162162
spec:
163163
containers:
164164
- name: jnlp
165-
image: 'jenkins/inbound-agent:4.7-1'
165+
image: 'jenkins/inbound-agent'
166166
args: ['\$(JENKINS_SECRET)', '\$(JENKINS_NAME)']
167167
```
168168
@@ -911,24 +911,7 @@ However, if your Jenkins controller has HTTPS configured with self-signed certif
911911
To do that, you can extend the `jenkins/inbound-agent` image and add your certificate as follows:
912912

913913
```Dockerfile
914-
FROM jenkins/inbound-agent:jdk8
915-
916-
USER root
917-
918-
ADD cert.pem /tmp/cert.pem
919-
920-
RUN keytool -noprompt -storepass changeit \
921-
-keystore "$JAVA_HOME/jre/lib/security/cacerts" \
922-
-import -file /tmp/cert.pem -alias jenkinsMaster && \
923-
rm -f /tmp/cert.pem
924-
925-
USER jenkins
926-
```
927-
928-
Or, if you are using JDK 11:
929-
930-
```Dockerfile
931-
FROM jenkins/inbound-agent:jdk11
914+
FROM jenkins/inbound-agent
932915
933916
USER root
934917

README_zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ podTemplate(label: label) {
7676
可以在模板中自定义 `jnlp` 节点镜像
7777

7878
```groovy
79-
containerTemplate(name: 'jnlp', image: 'jenkins/inbound-agent:4.3-4-alpine', args: '${computer.jnlpmac} ${computer.name}'),
79+
containerTemplate(name: 'jnlp', image: 'jenkins/inbound-agent', args: '${computer.jnlpmac} ${computer.name}'),
8080
```
8181

8282
或者使用 `yaml` 语法
@@ -87,7 +87,7 @@ kind: Pod
8787
spec:
8888
containers:
8989
- name: jnlp
90-
image: 'jenkins/inbound-agent:4.3-4-alpine'
90+
image: 'jenkins/inbound-agent'
9191
args: ['\$(JENKINS_SECRET)', '\$(JENKINS_NAME)']
9292
```
9393

examples/openshift-home-yaml.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ podTemplate(yaml:'''
99
spec:
1010
containers:
1111
- name: jnlp
12-
image: jenkins/inbound-agent:4.7-1
12+
image: jenkins/inbound-agent
1313
volumeMounts:
1414
- name: home-volume
1515
mountPath: /home/jenkins

kind.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ set -euxo pipefail
44
export PATH=$WSTMP:$PATH
55
if [ \! -x $WSTMP/kind ]
66
then
7-
curl -Lo $WSTMP/kind https://github.com/kubernetes-sigs/kind/releases/download/v0.11.1/kind-$(uname | tr '[:upper:]' '[:lower:]')-amd64
7+
curl -sLo $WSTMP/kind https://github.com/kubernetes-sigs/kind/releases/download/v0.17.0/kind-$(uname | tr '[:upper:]' '[:lower:]')-amd64
88
chmod +x $WSTMP/kind
99
fi
1010
if [ \! -x $WSTMP/kubectl ]
1111
then
12-
curl -Lo $WSTMP/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.21.3/bin/$(uname | tr '[:upper:]' '[:lower:]')/amd64/kubectl
12+
curl -sLo $WSTMP/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.25.4/bin/$(uname | tr '[:upper:]' '[:lower:]')/amd64/kubectl
1313
chmod +x $WSTMP/kubectl
1414
fi
1515

1616
export cluster=ci$RANDOM
1717
export KUBECONFIG=$WSTMP/kubeconfig-$cluster
18-
kind create cluster --name $cluster --wait 5m --config kind.yaml
18+
kind create cluster --name $cluster --wait 5m
1919
function cleanup() {
2020
kind export logs --name $cluster $WSTMP/kindlogs || :
2121
kind delete cluster --name $cluster || :

kind.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

pom.xml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<parent>
44
<groupId>org.jenkins-ci.plugins</groupId>
55
<artifactId>plugin</artifactId>
6-
<version>4.51</version>
7-
<relativePath />
6+
<version>4.53</version>
7+
<relativePath/>
88
</parent>
99

1010
<groupId>org.csanchez.jenkins.plugins</groupId>
@@ -45,7 +45,7 @@
4545
<connectorHost />
4646
<jenkins.host.address />
4747
<slaveAgentPort />
48-
<jenkins.version>2.346.1</jenkins.version>
48+
<jenkins.version>2.361.4</jenkins.version>
4949
<no-test-jar>false</no-test-jar>
5050
<useBeta>true</useBeta>
5151
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
@@ -104,7 +104,6 @@
104104
<dependency>
105105
<groupId>org.jenkins-ci.plugins.workflow</groupId>
106106
<artifactId>workflow-api</artifactId>
107-
<version>1200.v8005c684b_a_c6</version> <!-- TODO until in BOM -->
108107
</dependency>
109108
<dependency> <!-- DeclarativeAgent -->
110109
<groupId>org.jenkinsci.plugins</groupId>
@@ -137,7 +136,6 @@
137136
<dependency>
138137
<groupId>org.jenkins-ci.plugins.workflow</groupId>
139138
<artifactId>workflow-durable-task-step</artifactId>
140-
<version>1206.v8a_d5f86e336b</version> <!-- TODO until in BOM -->
141139
</dependency>
142140

143141
<!-- for testing -->
@@ -225,7 +223,7 @@
225223
<dependency>
226224
<groupId>org.jenkins-ci.plugins</groupId>
227225
<artifactId>docker-workflow</artifactId>
228-
<version>1.26</version>
226+
<version>563.vd5d2e5c4007f</version>
229227
<scope>test</scope>
230228
</dependency>
231229
<dependency>
@@ -253,17 +251,11 @@
253251
<dependencies>
254252
<dependency>
255253
<groupId>io.jenkins.tools.bom</groupId>
256-
<artifactId>bom-2.346.x</artifactId>
257-
<version>1643.v1cffef51df73</version>
254+
<artifactId>bom-2.361.x</artifactId>
255+
<version>1742.vb_70478c1b_25f</version>
258256
<scope>import</scope>
259257
<type>pom</type>
260258
</dependency>
261-
<!-- Fix InjectedTest -->
262-
<dependency>
263-
<groupId>org.jenkins-ci.plugins</groupId>
264-
<artifactId>docker-commons</artifactId>
265-
<version>1.18</version>
266-
</dependency>
267259
</dependencies>
268260
</dependencyManagement>
269261

src/main/java/org/csanchez/jenkins/plugins/kubernetes/PodTemplateBuilder.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
import io.fabric8.kubernetes.api.model.VolumeMount;
7878
import io.fabric8.kubernetes.api.model.VolumeMountBuilder;
7979
import io.fabric8.kubernetes.client.utils.Serialization;
80-
import io.jenkins.lib.versionnumber.JavaSpecificationVersion;
8180
import jenkins.model.Jenkins;
8281

8382
import static org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud.JNLP_NAME;
@@ -113,12 +112,7 @@ public class PodTemplateBuilder {
113112
String s = IOUtils.readFirstLine(dockerfileStream, StandardCharsets.UTF_8.toString());
114113
Matcher matcher = FROM_DIRECTIVE.matcher(s);
115114
if (matcher.matches()) {
116-
String name = matcher.group(1);
117-
if (JavaSpecificationVersion.forCurrentJVM().isNewerThanOrEqualTo(JavaSpecificationVersion.JAVA_11)) {
118-
defaultImageName = name + "-jdk11";
119-
} else {
120-
defaultImageName = name + "-jdk8";
121-
}
115+
defaultImageName = matcher.group(1);
122116
} else {
123117
throw new IllegalStateException("Dockerfile in plugin resources doesn't have the expected content");
124118
}

src/main/java/org/csanchez/jenkins/plugins/kubernetes/pod/retention/Reaper.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
import hudson.model.TaskListener;
3232
import hudson.model.listeners.ItemListener;
3333
import hudson.model.listeners.SaveableListener;
34-
import hudson.security.ACL;
35-
import hudson.security.ACLContext;
3634
import hudson.slaves.ComputerListener;
3735
import hudson.slaves.EphemeralNode;
3836
import io.fabric8.kubernetes.api.model.ContainerStateTerminated;
@@ -59,6 +57,7 @@
5957
import java.util.logging.Level;
6058
import java.util.logging.Logger;
6159
import jenkins.model.Jenkins;
60+
import jenkins.util.Listeners;
6261
import jenkins.util.Timer;
6362
import org.csanchez.jenkins.plugins.kubernetes.KubernetesClientProvider;
6463
import org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud;
@@ -314,7 +313,7 @@ public void eventReceived(Action action, Pod pod) {
314313
return;
315314
}
316315

317-
ExtensionList.lookup(Listener.class).forEach(listener -> { // TODO 2.324+ jenkins.util.Listeners
316+
Listeners.notify(Listener.class, true, listener -> {
318317
try {
319318
listener.onEvent(action, optionalNode.get(), pod, terminationReasons.get(optionalNode.get().getNodeName()));
320319
} catch (Exception x) {
@@ -420,9 +419,7 @@ public void onEvent(@NonNull Watcher.Action action, @NonNull KubernetesSlave nod
420419
}
421420
});
422421
logLastLinesThenTerminateNode(node, pod, runListener);
423-
try (ACLContext context = ACL.as(ACL.SYSTEM)) {
424-
PodUtils.cancelQueueItemFor(pod, "ContainerError");
425-
}
422+
PodUtils.cancelQueueItemFor(pod, "ContainerError");
426423
}
427424
}
428425
}
@@ -486,9 +483,7 @@ public void onEvent(@NonNull Watcher.Action action, @NonNull KubernetesSlave nod
486483
}
487484
});
488485
terminationReasons.add("ImagePullBackOff");
489-
try (ACLContext context = ACL.as(ACL.SYSTEM)) {
490-
PodUtils.cancelQueueItemFor(pod, "ImagePullBackOff");
491-
}
486+
PodUtils.cancelQueueItemFor(pod, "ImagePullBackOff");
492487
node.terminate();
493488
}
494489
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM jenkins/inbound-agent:4.11-1
1+
FROM jenkins/inbound-agent:3077.vd69cf116da_6f-3-jdk11

0 commit comments

Comments
 (0)