Skip to content

Commit 75d5e74

Browse files
authored
Merge pull request #1306 from Vlatombe/update-kubernetes-client-api-6.4.x
Upgrade kubernetes-client-api to 6.4.x line
2 parents 760b4a6 + d0d8105 commit 75d5e74

File tree

4 files changed

+4
-25
lines changed

4 files changed

+4
-25
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<dependency>
5757
<groupId>org.jenkins-ci.plugins</groupId>
5858
<artifactId>kubernetes-client-api</artifactId>
59-
<version>6.3.1-206.v76d3b_6b_14db_b</version>
59+
<version>6.4.1-208.vfe09a_9362c2c</version>
6060
</dependency>
6161
<dependency>
6262
<groupId>org.jenkins-ci.plugins</groupId>

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,7 @@ public KubernetesClient createClient() throws KubernetesAuthException {
157157
}
158158
}
159159
}
160-
// TODO post 2.362 use jenkins.util.SetContextClassLoader
161-
try (WithContextClassLoader ignored = new WithContextClassLoader(getClass().getClassLoader())) {
162-
return new KubernetesClientBuilder().withConfig(builder.build()).build();
163-
}
160+
return new KubernetesClientBuilder().withConfig(builder.build()).build();
164161
}
165162

166163
/**

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,16 +599,15 @@ public static String substitute(String s, Map<String, String> properties, String
599599

600600
public static Pod parseFromYaml(String yaml) {
601601
String s = yaml;
602-
try (WithContextClassLoader ignored = new WithContextClassLoader(PodTemplateUtils.class.getClassLoader());
603-
KubernetesClient client = new KubernetesClientBuilder().build()) {
602+
try (KubernetesClient client = new KubernetesClientBuilder().build()) {
604603
// JENKINS-57116
605604
if (StringUtils.isBlank(s)) {
606605
LOGGER.log(Level.WARNING, "[JENKINS-57116] Trying to parse invalid yaml: \"{0}\"", yaml);
607606
s = "{}";
608607
}
609608
Pod podFromYaml;
610609
try (InputStream is = new ByteArrayInputStream(s.getBytes(UTF_8))) {
611-
podFromYaml = client.pods().load(is).get();
610+
podFromYaml = client.pods().load(is).item();
612611
} catch (IOException | KubernetesClientException e) {
613612
throw new RuntimeException(String.format("Failed to parse yaml: \"%s\"", yaml), e);
614613
}

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

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

0 commit comments

Comments
 (0)