We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7dcfa8 commit 19b58cdCopy full SHA for 19b58cd
1 file changed
modules/k3s/src/main/java/org/testcontainers/k3s/K3sContainer.java
@@ -50,7 +50,12 @@ protected void containerIsStarted(InspectContainerResponse containerInfo) {
50
is -> objectMapper.readValue(is, ObjectNode.class)
51
);
52
53
- ObjectNode clusterConfig = rawKubeConfig.at("/clusters/0/cluster").require();
+ 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
+
59
clusterConfig.replace("server", new TextNode("https://" + this.getHost() + ":" + this.getMappedPort(6443)));
60
61
rawKubeConfig.set("current-context", new TextNode("default"));
0 commit comments