Skip to content

Commit 4ff55a2

Browse files
committed
Removes unnecessary .split().
1 parent bd05790 commit 4ff55a2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

libs/testing/src/main/java/no/nav/dolly/libs/nais/NaisRuntimeEnvironmentConnector.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private List<String> getAllPodsInClusterWithName(String cluster, String name)
126126
private List<String> execute(String command)
127127
throws NaisEnvironmentException {
128128

129-
var processBuilder = new ProcessBuilder(command.split(" "));
129+
var processBuilder = new ProcessBuilder(command);
130130
try {
131131
var process = processBuilder.start();
132132
var reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
@@ -144,8 +144,7 @@ private List<String> execute(String command)
144144
log.warn("Interrupted while waiting for command: {}", command, e);
145145
Thread.currentThread().interrupt();
146146
return List.of();
147-
}
148-
catch (Exception e) {
147+
} catch (Exception e) {
149148
throw new NaisEnvironmentException("Failed to execute command: " + command, e);
150149
}
151150

0 commit comments

Comments
 (0)