clean up / optimizations

This commit is contained in:
Roman committed 2020-06-16 12:44:03 +03:00
1 parent 606d1a9198
commit 1fa523c012
3 files changed
+6 -5

No files matched your search

+2 -2
View File
@@ -173,7 +173,7 @@ export class ContextHandler {
}
public applyHeaders(req: http.IncomingMessage) {
req.headers["authorization"] = `Bearer ${this.id}` // Q: how it works when id == cluster.id ?
req.headers["authorization"] = `Bearer ${this.id}`
}
public async withTemporaryKubeconfig(callback: (kubeconfig: string) => Promise<any>) {
@@ -188,7 +188,7 @@ export class ContextHandler {
if (!this.proxyServer) {
const proxyPort = await this.resolveProxyPort()
const proxyEnv = Object.assign({}, process.env)
if (this.cluster.preferences && this.cluster.preferences.httpsProxy) {
if (this.cluster?.preferences.httpsProxy) {
proxyEnv.HTTPS_PROXY = this.cluster.preferences.httpsProxy
}
this.proxyServer = new KubeAuthProxy(this.cluster, proxyPort, proxyEnv)