mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add NO_PROXY to shell env
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
parent
e1e3a4695a
commit
147f43c6a0
@ -283,7 +283,9 @@ export class Kubectl {
|
|||||||
bashScript += "fi\n"
|
bashScript += "fi\n"
|
||||||
bashScript += `export PATH="${helmPath}:${kubectlPath}:$PATH"\n`
|
bashScript += `export PATH="${helmPath}:${kubectlPath}:$PATH"\n`
|
||||||
bashScript += "export KUBECONFIG=\"$tempkubeconfig\"\n"
|
bashScript += "export KUBECONFIG=\"$tempkubeconfig\"\n"
|
||||||
bashScript += "export NO_PROXY=localhost,127.0.0.1,$NO_PROXY\n"
|
bashScript += "if [ \"$NO_PROXY\" != \"localhost,127.0.0.1\" ]; then\n"
|
||||||
|
bashScript += " export NO_PROXY=\"localhost,127.0.0.1,$NO_PROXY\"\n"
|
||||||
|
bashScript += "fi\n"
|
||||||
bashScript += "unset tempkubeconfig\n"
|
bashScript += "unset tempkubeconfig\n"
|
||||||
await fsPromises.writeFile(bashScriptPath, bashScript.toString(), { mode: 0o644 })
|
await fsPromises.writeFile(bashScriptPath, bashScript.toString(), { mode: 0o644 })
|
||||||
|
|
||||||
@ -309,7 +311,9 @@ export class Kubectl {
|
|||||||
zshScript += "d=${d/#:/}\n"
|
zshScript += "d=${d/#:/}\n"
|
||||||
zshScript += "export PATH=\"$helmpath:$kubectlpath:${d/%:/}\"\n"
|
zshScript += "export PATH=\"$helmpath:$kubectlpath:${d/%:/}\"\n"
|
||||||
zshScript += "export KUBECONFIG=\"$tempkubeconfig\"\n"
|
zshScript += "export KUBECONFIG=\"$tempkubeconfig\"\n"
|
||||||
zshScript += "export NO_PROXY=localhost,127.0.0.1,$NO_PROXY\n"
|
zshScript += "if [ \"$NO_PROXY\" != \"localhost,127.0.0.1\" ]; then\n"
|
||||||
|
zshScript += " export NO_PROXY=\"localhost,127.0.0.1,$NO_PROXY\"\n"
|
||||||
|
zshScript += "fi\n"
|
||||||
zshScript += "unset tempkubeconfig\n"
|
zshScript += "unset tempkubeconfig\n"
|
||||||
zshScript += "unset OLD_ZDOTDIR\n"
|
zshScript += "unset OLD_ZDOTDIR\n"
|
||||||
await fsPromises.writeFile(zshScriptPath, zshScript.toString(), { mode: 0o644 })
|
await fsPromises.writeFile(zshScriptPath, zshScript.toString(), { mode: 0o644 })
|
||||||
|
|||||||
@ -125,6 +125,8 @@ export class ShellSession extends EventEmitter {
|
|||||||
if (this.preferences.httpsProxy) {
|
if (this.preferences.httpsProxy) {
|
||||||
env["HTTPS_PROXY"] = this.preferences.httpsProxy
|
env["HTTPS_PROXY"] = this.preferences.httpsProxy
|
||||||
}
|
}
|
||||||
|
const no_proxy = ["localhost", "127.0.0.1", env["NO_PROXY"]]
|
||||||
|
env["NO_PROXY"] = no_proxy.filter(address => !!address).join()
|
||||||
if (env.DEBUG) { // do not pass debug option to bash
|
if (env.DEBUG) { // do not pass debug option to bash
|
||||||
delete env["DEBUG"]
|
delete env["DEBUG"]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user