Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kube-workflow

Package Overview
Dependencies
Maintainers
1
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kube-workflow - npm Package Compare versions

Comparing version 1.10.3 to 1.10.4

src/utils/deepmerge.js

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc