Skip to content

Commit 19b58cd

Browse files
authored
Use 2.8.8 compatible Jackson API (#4930)
1 parent f7dcfa8 commit 19b58cd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/k3s/src/main/java/org/testcontainers/k3s/K3sContainer.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ protected void containerIsStarted(InspectContainerResponse containerInfo) {
5050
is -> objectMapper.readValue(is, ObjectNode.class)
5151
);
5252

53-
ObjectNode clusterConfig = rawKubeConfig.at("/clusters/0/cluster").require();
53+
JsonNode clusterNode = rawKubeConfig.at("/clusters/0/cluster");
54+
if (!clusterNode.isObject()) {
55+
throw new IllegalStateException("'/clusters/0/cluster' expected to be an object");
56+
}
57+
ObjectNode clusterConfig = (ObjectNode) clusterNode;
58+
5459
clusterConfig.replace("server", new TextNode("https://" + this.getHost() + ":" + this.getMappedPort(6443)));
5560

5661
rawKubeConfig.set("current-context", new TextNode("default"));

0 commit comments

Comments
 (0)