Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
colemickens committed Mar 20, 2018
1 parent 26ee3e2 commit 1b7f3f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,12 @@ public void setUp(Context context, Run<?, ?> build, FilePath workspace, Launcher
if (c instanceof FileCredentials) {
InputStream configStream = ((FileCredentials) c).getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(configStream, StandardCharsets.UTF_8));
String kubeconfigContents = reader.lines().collect(Collectors.joining("\n"));
configFile.write(kubeconfigContents, null);
reader.close();
try {
String kubeconfigContents = reader.lines().collect(Collectors.joining("\n"));
configFile.write(kubeconfigContents, null);
} finally {
reader.close();
}
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,13 @@ public KubernetesClient createClient() throws NoSuchAlgorithmException, Unrecove
if (credentials instanceof FileCredentials) {
InputStream configStream = ((FileCredentials) credentials).getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(configStream, StandardCharsets.UTF_8));
String kubeconfigContents = reader.lines().collect(Collectors.joining("\n"));
Config config = Config.fromKubeconfig(kubeconfigContents);
builder = new ConfigBuilder(config);
reader.close();
try {
String kubeconfigContents = reader.lines().collect(Collectors.joining("\n"));
Config config = Config.fromKubeconfig(kubeconfigContents);
builder = new ConfigBuilder(config);
} finally {
reader.close();
}
} else if (credentials instanceof StringCredentials) {
final String token = ((StringCredentials) credentials).getSecret().getPlainText();
builder.withOauthToken(token);
Expand Down

0 comments on commit 1b7f3f0

Please sign in to comment.