Skip to content

Commit 9580b62

Browse files
add no_proxy to runner init (#583)
1 parent 07bcb69 commit 9580b62

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

lib/interface/cli/commands/hybrid/helper.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,9 +902,11 @@ function serealizeToKeyValuePairs(obj) {
902902
function detectProxy() {
903903
const httpProxy = process.env.http_proxy || process.env.HTTP_PROXY;
904904
const httpsProxy = process.env.https_proxy || process.env.HTTPS_PROXY;
905+
const noProxy = process.env.no_proxy || process.env.NO_PROXY;
905906
return {
906907
httpProxy,
907908
httpsProxy,
909+
noProxy,
908910
};
909911
}
910912

lib/interface/cli/commands/hybrid/init.cmd.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ const initCmd = new Command({
164164
.option('https-proxy', {
165165
describe: 'https proxy to be used in the runner',
166166
})
167+
.option('no-proxy', {
168+
describe: 'no_proxy to be used in the runner',
169+
})
167170
.option('verbose', {
168171
describe: 'Print logs',
169172
})
@@ -234,6 +237,7 @@ const initCmd = new Command({
234237
'env-vars': envVars,
235238
'http-proxy': httpProxy,
236239
'https-proxy': httpsProxy,
240+
'no-proxy': noProxy,
237241
url,
238242
token,
239243
name,
@@ -298,6 +302,7 @@ const initCmd = new Command({
298302
const detectedProxyVars = detectProxy();
299303
httpProxy = httpProxy || detectedProxyVars.httpProxy;
300304
httpsProxy = httpsProxy || detectedProxyVars.httpsProxy;
305+
noProxy = noProxy || detectedProxyVars.noProxy;
301306
envVars = envVars || [];
302307
if (!Array.isArray(envVars)) {
303308
envVars = [envVars];
@@ -352,6 +357,15 @@ const initCmd = new Command({
352357

353358
});
354359
}
360+
if (noProxy) {
361+
questions.push({
362+
type: 'input',
363+
name: 'noProxy',
364+
default: noProxy,
365+
message: 'NO_PROXY to be used by runner inside Kubernetes?',
366+
367+
});
368+
}
355369

356370
if (appProxy && !appProxyHost) {
357371
// will only be asked if you want to install app-proxy but you give no host in the options
@@ -449,6 +463,10 @@ const initCmd = new Command({
449463
envVars.push(`https_proxy=${httpsProxy}`);
450464
envVars.push(`HTTPS_PROXY=${httpsProxy}`);
451465
}
466+
if (noProxy) {
467+
envVars.push(`no_proxy=${noProxy}`);
468+
envVars.push(`NO_PROXY=${noProxy}`);
469+
}
452470

453471
// save the answers for backup
454472
_argv['kube-context-name'] = kubeContextName;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.73.13",
3+
"version": "0.73.14",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)