Skip to content

Commit 7277ec1

Browse files
Saas 8012 - patching runtime-images and added insecure flag to attach-runtime (#531)
1 parent 5f1e036 commit 7277ec1

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ const INSTALLATION_DEFAULTS = {
3030
COMPONENTS_FOLDER: 'components',
3131
};
3232

33+
const RUNTIME_IMAGES = {
34+
DOCKER_PUSHER_IMAGE: 'codefresh/cf-docker-pusher:v5',
35+
DOCKER_PULLER_IMAGE: 'codefresh/cf-docker-puller:v7',
36+
DOCKER_TAG_PUSHER_IMAGE: 'codefresh/cf-docker-tag-pusher:v2',
37+
DOCKER_BUILDER_IMAGE: 'codefresh/cf-docker-builder:v16',
38+
GC_BUILDER_IMAGE: 'codefresh/cf-gc-builder:0.4.0',
39+
CONTAINER_LOGGER_IMAGE: 'codefresh/cf-container-logger:1.4.2',
40+
GIT_CLONE_IMAGE: 'codefresh/cf-git-cloner:10.0.1',
41+
COMPOSE_IMAGE: 'docker/compose:1.11.2',
42+
KUBE_DEPLOY: 'codefresh/cf-deploy-kubernetes:latest',
43+
FS_OPS_IMAGE: 'codefresh/fs-ops:latest',
44+
TEMPLATE_ENGINE: 'codefresh/pikolo:latest',
45+
PIPELINE_DEBUGGER_IMAGE: 'codefresh/cf-debugger:1.1.2',
46+
};
47+
3348
const maxRuntimeNameLength = 63;
3449
const DefaultLogFormatter = 'plain';
3550

@@ -549,6 +564,9 @@ async function installRuntime({
549564
if (storageClassName) {
550565
cmd.push(`--storage-class=${storageClassName}`);
551566
}
567+
if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0') {
568+
cmd.push('--insecure');
569+
}
552570

553571
await componentRunner.run(components.venona, cmd);
554572
}
@@ -690,6 +708,13 @@ function detectProxy() {
690708
};
691709
}
692710

711+
function getRuntimeImagesWithRegistryUrl(registry) {
712+
return Object.keys(RUNTIME_IMAGES).reduce((acc, cur) => {
713+
acc[cur] = `${registry}/${RUNTIME_IMAGES[cur]}`;
714+
return acc;
715+
}, {});
716+
}
717+
693718
module.exports = {
694719
getRelatedAgents,
695720
createErrorHandler,
@@ -718,6 +743,7 @@ module.exports = {
718743
runUpgrade,
719744
detectProxy,
720745
serealizeToKeyValuePairs,
746+
getRuntimeImagesWithRegistryUrl,
721747
INSTALLATION_DEFAULTS,
722748
DefaultLogFormatter,
723749
};

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const {
3131
detectProxy,
3232
keyValueAsStringToObject,
3333
serealizeToKeyValuePairs,
34+
getRuntimeImagesWithRegistryUrl,
3435
INSTALLATION_DEFAULTS,
3536
} = require('./helper');
3637
const InstallationPlan = require('./InstallationPlan');
@@ -444,6 +445,21 @@ const initCmd = new Command({
444445
},
445446
});
446447

448+
// update runtime images with docker-registry
449+
installationPlan.addStep({
450+
name: 'update runtime environment images with docker-registry url',
451+
func: async () => {
452+
const reName = installationPlan.getContext('runtimeName');
453+
const re = await sdk.runtimeEnvs.get({ name: reName });
454+
const body = _.set({}, 'runtimeScheduler.envVars', getRuntimeImagesWithRegistryUrl(dockerRegistry));
455+
_.set(body, 'runtimeScheduler.image', `${dockerRegistry}/codefresh/engine:master`);
456+
_.set(body, 'dockerDaemonScheduler.dindImage', `${dockerRegistry}/codefresh/dind:18.09.5-v24-sp`);
457+
await sdk.runtimeEnvs.update({ name: reName }, _.merge(re, body));
458+
console.log(`Runtime environment "${colors.cyan(reName)}" has been updated with the specified docker-registry images`);
459+
},
460+
condition: !!dockerRegistry,
461+
});
462+
447463
// set runtime as default
448464
installationPlan.addStep({
449465
name: 'set new runtime as default',

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

0 commit comments

Comments
 (0)