Skip to content

Commit d683e23

Browse files
authored
runtime node-selector-fix (#433)
* node-selector-fix for install runtime
1 parent 4ea12a9 commit d683e23

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

codefresh.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ steps:
3939
type: push
4040
candidate: ${{build_step}}
4141
tag: ${{CF_SHORT_REVISION}}
42-
registry: "CFCR"
4342

4443
execute_release_pipeline:
4544
title: "Execute release pipeline in case version was changed"

lib/interface/cli/commands/runtimeEnvironments/install.cmd.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,19 @@ const installRuntimeCmd = new Command({
130130
throw new Error('runtime-kube-namespace is mandatory parameter');
131131
}
132132

133+
// parse kubeNodeSelector in form key1=value1,key2=value2 to {key1: value1, key2: value2}
134+
let kubeNodeSelectorObj = {};
135+
if (kubeNodeSelector) {
136+
const nsSplitParts = kubeNodeSelector.split(',');
137+
nsSplitParts.forEach( nsPart => {
138+
const nsRecordSplit = nsPart.split('=');
139+
if (nsRecordSplit.length !== 2) {
140+
throw new Error('invalid kube-node-selector parameter');
141+
}
142+
kubeNodeSelectorObj[nsRecordSplit[0]] = nsRecordSplit[1];
143+
});
144+
}
145+
133146
const apiHost = sdk.config.context.url;
134147
if (!kubeContextName) {
135148
kubeContextName = getKubeContext(kubeConfigPath);
@@ -147,7 +160,7 @@ const installRuntimeCmd = new Command({
147160
namespace: kubeNamespace,
148161
storageClassName,
149162
runnerType: kubernetesRunnerType,
150-
nodeSelector: kubeNodeSelector,
163+
nodeSelector: kubeNodeSelectorObj,
151164
annotations: buildAnnotations,
152165
clusterName,
153166
agent: true,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.50.3",
3+
"version": "0.50.4",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)