diff --git a/lib/interface/cli/commands/hybrid/helper.js b/lib/interface/cli/commands/hybrid/helper.js index 083357940..fd3c26a3c 100644 --- a/lib/interface/cli/commands/hybrid/helper.js +++ b/lib/interface/cli/commands/hybrid/helper.js @@ -1070,6 +1070,12 @@ function mergeValuesFromValuesFile(argv, valuesFile, handleError) { if (_.has(valuesObj, 'Runtime.resources')) { _.set(_argv, 'reResources', valuesObj.Runtime.resources); } + if (_.has(valuesObj, 'Runtime.userVolumeMounts')) { + _.set(_argv, 'userVolumeMounts', valuesObj.Runtime.userVolumeMounts); + } + if (_.has(valuesObj, 'Runtime.userVolumes')) { + _.set(_argv, 'userVolumes', valuesObj.Runtime.userVolumes); + } return _argv; } diff --git a/lib/interface/cli/commands/hybrid/init.cmd.js b/lib/interface/cli/commands/hybrid/init.cmd.js index f8c17ad46..e184aa097 100644 --- a/lib/interface/cli/commands/hybrid/init.cmd.js +++ b/lib/interface/cli/commands/hybrid/init.cmd.js @@ -249,6 +249,8 @@ const initCmd = new Command({ runtimeName, reEnvVars, reResources, + userVolumeMounts, + userVolumes, } = _argv; let { 'kube-context-name': kubeContextName, @@ -589,10 +591,22 @@ const initCmd = new Command({ _.set(re, 'dockerDaemonScheduler.defaultDindResources', reResources); } + if (userVolumeMounts) { + const currentdockerDaemonScheduler = _.get(re, 'dockerDaemonScheduler', {}); + const newDockerDaemonScheduler = _.merge(currentdockerDaemonScheduler, { userVolumeMounts }); + _.set(re, 'dockerDaemonScheduler', newDockerDaemonScheduler); + } + + if (userVolumes) { + const currentdockerDaemonScheduler = _.get(re, 'dockerDaemonScheduler', {}); + const newDockerDaemonScheduler = _.merge(currentdockerDaemonScheduler, { userVolumes }); + _.set(re, 'dockerDaemonScheduler', newDockerDaemonScheduler); + } + await sdk.runtimeEnvs.update({ name: reName }, re); console.log(`Runtime environment "${colors.cyan(reName)}" has been updated with env vars`); }, - condition: envVars.length || reResources, + condition: envVars.length || reResources || userVolumeMounts || userVolumes, }); // set runtime as default diff --git a/package.json b/package.json index f2b8613c6..573860ee6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codefresh", - "version": "0.73.20", + "version": "0.73.21", "description": "Codefresh command line utility", "main": "index.js", "preferGlobal": true,