From b2d6d5db9be47a28c440f48e8bde93d5a673c552 Mon Sep 17 00:00:00 2001 From: yuri-denysenko-codefresh <70644032+yuri-denysenko-codefresh@users.noreply.github.com> Date: Sun, 11 Apr 2021 09:07:46 +0300 Subject: [PATCH] CR-1288 Storing tolerations in RE (#642) * Storing tolerations in RE * Fixes --- lib/interface/cli/commands/hybrid/helper.js | 3 +++ lib/interface/cli/commands/hybrid/init.cmd.js | 8 +++++++- package.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/interface/cli/commands/hybrid/helper.js b/lib/interface/cli/commands/hybrid/helper.js index 385b69929..3becdc9ca 100644 --- a/lib/interface/cli/commands/hybrid/helper.js +++ b/lib/interface/cli/commands/hybrid/helper.js @@ -1046,6 +1046,9 @@ function mergeValuesFromValuesFile(argv, valuesFile, handleError) { if (_.has(valuesObj, 'Runtime.resources')) { _.set(_argv, 'reResources', valuesObj.Runtime.resources); } + if (_.has(valuesObj, 'Runtime.tolerations')) { + _.set(_argv, 'reTolerations', valuesObj.Runtime.tolerations); + } if (_.has(valuesObj, 'Runtime.userVolumeMounts')) { _.set(_argv, 'userVolumeMounts', valuesObj.Runtime.userVolumeMounts); } diff --git a/lib/interface/cli/commands/hybrid/init.cmd.js b/lib/interface/cli/commands/hybrid/init.cmd.js index eaedef4c2..b9291a867 100644 --- a/lib/interface/cli/commands/hybrid/init.cmd.js +++ b/lib/interface/cli/commands/hybrid/init.cmd.js @@ -143,7 +143,7 @@ const initCmd = new Command({ describe: 'Name of the namespace on which runner should be installed [$CF_ARG_KUBE_NAMESPACE]', }) .option('tolerations', { - describe: 'The Kubernetes tolerations as path to a JSON file prefixed with @ to be used by runner resources (default is no tolerations) (string)', + describe: 'The Kubernetes tolerations as path to a JSON file prefixed with @ to be used by runner resources (default is no tolerations) (string)', }) .option('storage-class-name', { describe: 'Set a name of your custom storage class', @@ -263,6 +263,7 @@ const initCmd = new Command({ runtimeName, reEnvVars, reResources, + reTolerations, userVolumeMounts, userVolumes, 'dry-run': dryRun, @@ -609,6 +610,11 @@ const initCmd = new Command({ _.set(re, 'dockerDaemonScheduler.defaultDindResources', reResources); } + if (reTolerations) { + _.set(re, 'runtimeScheduler.tolerations', reTolerations); + _.set(re, 'dockerDaemonScheduler.tolerations', reTolerations); + } + if (userVolumeMounts) { const currentdockerDaemonScheduler = _.get(re, 'dockerDaemonScheduler', {}); const newDockerDaemonScheduler = _.merge(currentdockerDaemonScheduler, { userVolumeMounts }); diff --git a/package.json b/package.json index 50b3d592f..cb36a18de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codefresh", - "version": "0.75.8", + "version": "0.75.9", "description": "Codefresh command line utility", "main": "index.js", "preferGlobal": true,