kube-workflow
Advanced tools
Comparing version 1.10.3 to 1.10.4
{ | ||
"name": "kube-workflow", | ||
"version": "1.10.3", | ||
"version": "1.10.4", | ||
"repository": "git@github.com:SocialGouv/kube-workflow.git", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -6,3 +6,3 @@ const os = require("os") | ||
const yaml = require("js-yaml") | ||
const mergeWith = require("lodash.mergewith") | ||
const deepmerge = require("~/utils/deepmerge") | ||
@@ -100,7 +100,3 @@ const asyncShell = require("~/utils/async-shell") | ||
]) | ||
const values = mergeWith({}, defaultValues, commonValues, envValues, (objValue, srcValue) => { | ||
if (Array.isArray(objValue)) { | ||
return srcValue; | ||
} | ||
}) | ||
const values = deepmerge({}, defaultValues, commonValues, envValues) | ||
logger.debug("Compiling jobs") | ||
@@ -142,6 +138,30 @@ await compileJobs(values) | ||
for (const chartName of chartNames){ | ||
const envChartTemplatesDir = `${KWBUILD_PATH}/charts/${chartName}/${ENVIRONMENT}` | ||
const chartDir = `${KWBUILD_PATH}/charts/${chartName}` | ||
const envChartDir = `${chartDir}/${ENVIRONMENT}` | ||
const envChartTemplatesDir = `${envChartDir}//templates` | ||
if (await fs.pathExists(envChartTemplatesDir)){ | ||
await fs.copy(envChartTemplatesDir, `${KWBUILD_PATH}/charts/${chartName}/templates`, {dereference: true}) | ||
} | ||
const envValuesFiles = [`${envChartDir}/values.yaml`, `${envChartDir}/values.yml`] | ||
let envValuesFile | ||
for (const f of envValuesFiles) { | ||
if (await fs.pathExists(f)) { | ||
envValuesFile = f | ||
break | ||
} | ||
} | ||
if (envValuesFile){ | ||
const valuesFiles = [`${chartDir}/values.yaml`, `${chartDir}/values.yml`] | ||
let valuesFile | ||
for (const f of valuesFiles) { | ||
if (await fs.pathExists(f)) { | ||
valuesFile = f | ||
break | ||
} | ||
} | ||
let valuesObj = yaml.load(await fs.readFile(valuesFile)) | ||
valuesEnv = yaml.load(await fs.readFile(envValuesFile)) | ||
valuesObj = deepmerge(valuesObj, valuesEnv) | ||
await fs.writeFile(valuesFile, yaml.dump(valuesObj)) | ||
} | ||
} | ||
@@ -148,0 +168,0 @@ |
const fs = require("fs-extra") | ||
const yaml = require("js-yaml") | ||
const mergeWith = require("lodash.mergewith") | ||
const deepmerge = require("~/utils/deepmerge") | ||
@@ -63,7 +63,3 @@ const getDirectories = require("~/utils/get-directories") | ||
} | ||
const defaultValuesObj = mergeWith(values, defaultValues(c, chart), (objValue, srcValue) => { | ||
if (Array.isArray(objValue)) { | ||
return srcValue; | ||
} | ||
}) | ||
const defaultValuesObj = deepmerge(values, defaultValues(c, chart)) | ||
await fs.writeFile(valuesFile, yaml.dump(defaultValuesObj)) | ||
@@ -70,0 +66,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
251843
134
1542