Skip to content

Commit

Permalink
CR-1288 Storing tolerations in RE (#642)
Browse files Browse the repository at this point in the history
* Storing tolerations in RE

* Fixes
  • Loading branch information
yuri-denysenko-codefresh authored Apr 11, 2021
1 parent f38ef8d commit b2d6d5d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/interface/cli/commands/hybrid/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
8 changes: 7 additions & 1 deletion lib/interface/cli/commands/hybrid/init.cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -263,6 +263,7 @@ const initCmd = new Command({
runtimeName,
reEnvVars,
reResources,
reTolerations,
userVolumeMounts,
userVolumes,
'dry-run': dryRun,
Expand Down Expand Up @@ -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 });
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codefresh",
"version": "0.75.8",
"version": "0.75.9",
"description": "Codefresh command line utility",
"main": "index.js",
"preferGlobal": true,
Expand Down

0 comments on commit b2d6d5d

Please sign in to comment.