Skip to content
Snippets Groups Projects
Commit 8da8d7a0 authored by Martín Fernández's avatar Martín Fernández Committed by Rhys Arkins
Browse files

feat: Add DOCKER_HOST to child env (#5222)

Currently the DOCKER_HOST env variable is not passed to the child
environment making it impossible to use a non default docker host.
parent 8126705d
No related branches found
No related tags found
No related merge requests found
const basicEnvVars = ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY', 'HOME', 'PATH'];
const basicEnvVars = [
'HTTP_PROXY',
'HTTPS_PROXY',
'NO_PROXY',
'HOME',
'PATH',
'DOCKER_HOST',
];
export function getChildProcessEnv(
customEnvVars: string[] = []
......
import { getChildProcessEnv } from '../../lib/util/exec/env';
describe('getChildProcess environment when trustlevel set to low', () => {
const envVars = ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY', 'HOME', 'PATH'];
const envVars = [
'HTTP_PROXY',
'HTTPS_PROXY',
'NO_PROXY',
'HOME',
'PATH',
'DOCKER_HOST',
];
beforeEach(() => {
envVars.forEach(env => {
process.env[env] = env;
......@@ -13,6 +20,7 @@ describe('getChildProcess environment when trustlevel set to low', () => {
it('returns default environment variables', () => {
expect(getChildProcessEnv()).toMatchInlineSnapshot(`
Object {
"DOCKER_HOST": "DOCKER_HOST",
"HOME": "HOME",
"HTTPS_PROXY": "HTTPS_PROXY",
"HTTP_PROXY": "HTTP_PROXY",
......@@ -29,6 +37,7 @@ describe('getChildProcess environment when trustlevel set to low', () => {
process.env.LANG = 'LANG';
expect(getChildProcessEnv(['LANG'])).toMatchInlineSnapshot(`
Object {
"DOCKER_HOST": "DOCKER_HOST",
"HOME": "HOME",
"HTTPS_PROXY": "HTTPS_PROXY",
"HTTP_PROXY": "HTTP_PROXY",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment