Skip to content

Commit 2366abf

Browse files
authored
Merge pull request #65 from lwander/from-kube-config
Allow ApiClient to be constructed from KubeConfig
2 parents fd07810 + 2a599b2 commit 2366abf

File tree

1 file changed

+3
-1
lines changed
  • util/src/main/java/io/kubernetes/client/util

1 file changed

+3
-1
lines changed

util/src/main/java/io/kubernetes/client/util/Config.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ public static ApiClient fromConfig(InputStream stream) {
9999
}
100100

101101
public static ApiClient fromConfig(Reader input) {
102+
return fromConfig(KubeConfig.loadKubeConfig(input));
103+
}
102104

103-
KubeConfig config = KubeConfig.loadKubeConfig(input);
105+
public static ApiClient fromConfig(KubeConfig config) {
104106
ApiClient client = new ApiClient();
105107
client.setBasePath(config.getServer());
106108

0 commit comments

Comments
 (0)