Skip to content

Commit 692679b

Browse files
runner init improvements (#633)
1 parent f88da10 commit 692679b

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

lib/interface/cli/commands/hybrid/helper.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,11 @@ async function attachRuntime({
885885
cmd.push(`--values=${valuesFile}`);
886886
}
887887
if (setValue) {
888-
cmd.push(`--set-value=${setValue}`);
888+
if (_.isArray(setValue)) {
889+
setValue.forEach(sv => cmd.push(`--set-value=${sv}`));
890+
} else {
891+
cmd.push(`--set-value=${setValue}`);
892+
}
889893
}
890894
if (setFile) {
891895
cmd.push(`--set-file=${setFile}`);
@@ -1051,6 +1055,9 @@ function mergeValuesFromValuesFile(argv, valuesFile, handleError) {
10511055
if (!_.has(_argv, 'storage-class-name') && _.has(valuesObj, 'StorageClass')) {
10521056
_.set(_argv, 'storage-class-name', valuesObj.StorageClass);
10531057
}
1058+
if (!_.has(_argv, 'skip-cluster-integration') && _.has(valuesObj, 'SkipClusterIntegration')) {
1059+
_.set(_argv, 'skip-cluster-integration', valuesObj.SkipClusterIntegration);
1060+
}
10541061

10551062
return _argv;
10561063
}

lib/interface/cli/commands/hybrid/init.cmd.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ const initCmd = new Command({
121121
describe: 'Do not test given kubeconfig context to have all the required permission',
122122
type: 'boolean',
123123
})
124+
.option('skip-cluster-integration', {
125+
describe: 'Do not create a cluster integration in Codefresh',
126+
type: 'boolean',
127+
})
124128
.option('set-default-runtime', {
125129
describe: 'Set this as the default runtime environment for your Codefresh account',
126130
type: 'boolean',
@@ -246,6 +250,7 @@ const initCmd = new Command({
246250
'env-vars': envVars,
247251
yes: noQuestions,
248252
'skip-cluster-test': skipClusterTest,
253+
'skip-cluster-integration': skipClusterIntegration,
249254
'docker-registry': dockerRegistry,
250255
token,
251256
name,
@@ -648,6 +653,9 @@ const initCmd = new Command({
648653
},
649654
installationEvent: installationProgress.events.CLUSTER_INTEGRATION_ADDED,
650655
condition: async () => {
656+
if (skipClusterIntegration) {
657+
return false;
658+
}
651659
if (isInCluster()) {
652660
console.log('Cluster integration was not added , please add it via codefresh "create clusters [name]"');
653661
return false;
@@ -661,7 +669,6 @@ const initCmd = new Command({
661669
});
662670

663671
// install runtime on cluster
664-
setValue.push('--RuntimeInCluster=true');
665672
installationPlan.addStep({
666673
name: 'install runtime',
667674
func: async () => {
@@ -770,6 +777,9 @@ const initCmd = new Command({
770777
verbose, // --verbose
771778
runtimeName: installationPlan.getContext('runtimeName'), // --runtimeName
772779
dryRun,
780+
valuesFile,
781+
setValue,
782+
setFile,
773783
});
774784
},
775785
installationEvent: installationProgress.events.RUNNER_INSTALLED,
@@ -804,7 +814,7 @@ const initCmd = new Command({
804814
return false;
805815
}
806816

807-
if (isInCluster()) {
817+
if (isInCluster() || skipClusterIntegration) {
808818
console.log('Monitor component cannot be installed without cluster integration, you can install it seperately using: "codefresh install monitor"');
809819
return false;
810820
}

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.75.3",
3+
"version": "0.75.4",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)