File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
modules/k3s/src/main/java/org/testcontainers/k3s Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff 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" ));
You can’t perform that action at this time.
0 commit comments