async function addDeploymentEnvVars (config, resourceList) { return resourceList.map((resource) => { if (resource.kind === 'DeploymentConfig') { // Check for the env array in the spec.template.spec.containers array of the deployment config // If there is one, we need to see if it already has values and merge if necessarry const env = resource.spec.template.spec.containers[0].env; if (!env) { // If there isn't one, create it and add the --deploy.env stuff resource.spec.template.spec.containers[0].env = config.deploy && config.deploy.env ? config.deploy.env : []; return resource; } resource.spec.template.spec.containers[0].env = _.unionBy(config.deploy && config.deploy.env ? config.deploy.env : [], resource.spec.template.spec.containers[0].env, 'name'); return resource; } return resource; }); }