Skip to content

Commit 2df4593

Browse files
committed
feat(loadFromCluster): added option to prefix the kubernetes configuration path to use with telepresence
1 parent 80e7752 commit 2df4593

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)