Skip to content

Commit

Permalink
Fix telegram Openshift client
Browse files Browse the repository at this point in the history
  • Loading branch information
tplevko committed Nov 18, 2022
1 parent e757c12 commit 6920f1f
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import com.google.auto.service.AutoService;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -118,12 +118,12 @@ public boolean isDeployed() {

@Override
public String execInContainer(String... commands) {
ByteArrayOutputStream baosOutput = new ByteArrayOutputStream();

OpenshiftClient.get().pods().withName(OpenshiftClient.get().getAnyPod(name()).getMetadata().getName())
.writingOutput(baosOutput).exec(commands);

return baosOutput.toString();
try {
return new String(OpenshiftClient.get().pods().withName(OpenshiftClient.get().getAnyPod(name()).getMetadata().getName())
.redirectingOutput().exec(commands).getOutput().readAllBytes());
} catch (IOException e) {
throw new RuntimeException("Unable to read command output: " + e);
}
}

@Override
Expand Down

0 comments on commit 6920f1f

Please sign in to comment.