Skip to content

Commit 2ab8dd4

Browse files
authored
Merge pull request #102 from NicolaiSchmid/master
LoadFromCluster, added option to prefix the configuration file path
2 parents 80e7752 + ed04fc1 commit 2ab8dd4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

node-client/src/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class KubeConfig {
149149
];
150150
}
151151

152-
public loadFromCluster() {
152+
public loadFromCluster(pathPrefix: string = '') {
153153
const host = process.env.KUBERNETES_SERVICE_HOST;
154154
const port = process.env.KUBERNETES_SERVICE_PORT;
155155
const clusterName = 'inCluster';
@@ -164,7 +164,7 @@ export class KubeConfig {
164164
this.clusters = [
165165
{
166166
name: clusterName,
167-
caFile: Config.SERVICEACCOUNT_CA_PATH,
167+
caFile: `${pathPrefix}${Config.SERVICEACCOUNT_CA_PATH}`,
168168
caData: null,
169169
server: `${scheme}://${host}:${port}`,
170170
skipTLSVerify: false,
@@ -173,7 +173,7 @@ export class KubeConfig {
173173
this.users = [
174174
{
175175
name: userName,
176-
token: fs.readFileSync(Config.SERVICEACCOUNT_TOKEN_PATH).toString(),
176+
token: fs.readFileSync(`${pathPrefix}${Config.SERVICEACCOUNT_TOKEN_PATH}`).toString(),
177177
// empty defaults, fields are required...
178178
certData: null,
179179
certFile: null,

0 commit comments

Comments
 (0)