From e855716c5839e825dbdf13e828d317c453703174 Mon Sep 17 00:00:00 2001 From: Anatoliy Bazko Date: Thu, 14 May 2020 09:41:41 +0300 Subject: [PATCH 1/4] Use 'openshift-marketplace' for OpenShift platform familiy Signed-off-by: Anatoliy Bazko --- src/tasks/installers/common-tasks.ts | 2 +- src/tasks/installers/olm.ts | 6 +++--- src/tasks/installers/operator.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tasks/installers/common-tasks.ts b/src/tasks/installers/common-tasks.ts index 542a31973..f8bff3f2b 100644 --- a/src/tasks/installers/common-tasks.ts +++ b/src/tasks/installers/common-tasks.ts @@ -59,7 +59,7 @@ async function copyCheOperatorResources(templatesDir: string, cacheDir: string): return destDir } -export function createEclipeCheCluster(flags: any, kube: KubeHelper): ListrTask { +export function createEclipseCheCluster(flags: any, kube: KubeHelper): ListrTask { return { title: `Create Eclipse Che cluster ${CHE_CLUSTER_CR_NAME} in namespace ${flags.chenamespace}`, task: async (ctx: any, task: any) => { diff --git a/src/tasks/installers/olm.ts b/src/tasks/installers/olm.ts index e4b77c447..d064a0eff 100644 --- a/src/tasks/installers/olm.ts +++ b/src/tasks/installers/olm.ts @@ -17,7 +17,7 @@ import { CatalogSource, Subscription } from '../../api/typings/olm' import { DEFAULT_CHE_IMAGE, DEFAULT_CHE_OLM_PACKAGE_NAME, defaultOLMKubernetesNamespace, defaultOpenshiftMarketPlaceNamespace, OLM_STABLE_CHANNEL_NAME } from '../../constants' import { isKubernetesPlatformFamily } from '../../util' -import { checkTlsCertificate, copyOperatorResources, createEclipeCheCluster, createNamespaceTask } from './common-tasks' +import { checkTlsCertificate, copyOperatorResources, createEclipseCheCluster, createNamespaceTask } from './common-tasks' export class OLMTasks { private readonly customCatalogSourceName = 'eclipse-che-custom-catalog-source' @@ -52,7 +52,7 @@ export class OLMTasks { title: 'Configure context information', task: async (ctx: any, task: any) => { // Todo: should we do check for installer openshift? flags.platform === 'crc' || flags.platform === 'openshift' - ctx.defaultCatalogSourceNamespace = flags.platform === 'crc' ? defaultOpenshiftMarketPlaceNamespace : defaultOLMKubernetesNamespace + ctx.defaultCatalogSourceNamespace = isKubernetesPlatformFamily(flags.platform) ? defaultOLMKubernetesNamespace : defaultOpenshiftMarketPlaceNamespace // catalog source name for stable Che version ctx.catalogSourceNameStable = isKubernetesPlatformFamily(flags.platform) ? 'operatorhubio-catalog' : 'community-operators' @@ -119,7 +119,7 @@ export class OLMTasks { task.title = `${task.title}...done.` } }, - createEclipeCheCluster(flags, kube) + createEclipseCheCluster(flags, kube) ], { renderer: flags['listr-renderer'] as any }) } diff --git a/src/tasks/installers/operator.ts b/src/tasks/installers/operator.ts index 998dd19c0..15e8e5c1e 100644 --- a/src/tasks/installers/operator.ts +++ b/src/tasks/installers/operator.ts @@ -17,7 +17,7 @@ import * as Listr from 'listr' import { KubeHelper } from '../../api/kube' import { CHE_CLUSTER_CR_NAME } from '../../constants' -import { checkTlsCertificate, copyOperatorResources, createEclipeCheCluster, createNamespaceTask } from './common-tasks' +import { checkTlsCertificate, copyOperatorResources, createEclipseCheCluster, createNamespaceTask } from './common-tasks' export class OperatorTasks { operatorServiceAccount = 'che-operator' @@ -140,7 +140,7 @@ export class OperatorTasks { } } }, - createEclipeCheCluster(flags, kube) + createEclipseCheCluster(flags, kube) ], { renderer: flags['listr-renderer'] as any }) } From 9a5244fd36f17f41e1bff070145992548017365d Mon Sep 17 00:00:00 2001 From: Anatoliy Bazko Date: Thu, 14 May 2020 09:55:20 +0300 Subject: [PATCH 2/4] Fix Signed-off-by: Anatoliy Bazko --- src/tasks/installers/installer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks/installers/installer.ts b/src/tasks/installers/installer.ts index aa8f538f8..6e5cdc32a 100644 --- a/src/tasks/installers/installer.ts +++ b/src/tasks/installers/installer.ts @@ -89,7 +89,7 @@ export class InstallerTasks { // let task: Listr.ListrTask - if (flags.installer === 'operator') { + if (flags.installer === 'operator' || flags.installer === 'olm') { title = '🏃‍ Running the Eclipse Che operator' task = () => { // The operator installs Eclipse Che in multiuser mode by default From 5a417bee2a8bc186bebaa276783bc6f4e0062596 Mon Sep 17 00:00:00 2001 From: Anatoliy Bazko Date: Thu, 14 May 2020 10:31:00 +0300 Subject: [PATCH 3/4] Fix error Signed-off-by: Anatoliy Bazko --- src/tasks/installers/common-tasks.ts | 2 +- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tasks/installers/common-tasks.ts b/src/tasks/installers/common-tasks.ts index f8bff3f2b..e2e27e385 100644 --- a/src/tasks/installers/common-tasks.ts +++ b/src/tasks/installers/common-tasks.ts @@ -159,7 +159,7 @@ export function getMessageImportCaCertIntoBrowser(caCertFileLocation: string): s export function getRetrieveKeycloakCredentialsTask(flags: any): ListrTask { return { title: 'Retrieving Keycloak admin credentials', - enabled: (ctx: any) => !ctx.cr.spec.auth.externalIdentityProvider && flags.multiuser && (flags.installer !== 'operator' || flags.installer !== 'olm'), + enabled: (ctx: any) => ctx.cr && !ctx.cr.spec.auth.externalIdentityProvider && flags.multiuser && (flags.installer !== 'operator' || flags.installer !== 'olm'), task: async (ctx: any, task: any) => { const che = new CheHelper(flags) const [login, password] = await che.retrieveKeycloakAdminCredentials(flags.chenamespace) diff --git a/yarn.lock b/yarn.lock index 42e060eef..09a261ccd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1521,7 +1521,7 @@ ecc-jsbn@~0.1.1: "eclipse-che-operator@git://github.com/eclipse/che-operator#master": version "0.0.0" - resolved "git://github.com/eclipse/che-operator#daa8b582393a43b349a1678ad978e55e1241e94e" + resolved "git://github.com/eclipse/che-operator#803652d15193d175162c4819c779732e00ef9f39" "eclipse-che@git://github.com/eclipse/che#master": version "0.0.0" From bbbc4ceb13991d46d9532f77d3956e4f32a14e1d Mon Sep 17 00:00:00 2001 From: Anatoliy Bazko Date: Thu, 14 May 2020 11:14:48 +0300 Subject: [PATCH 4/4] Fixes Signed-off-by: Anatoliy Bazko --- src/tasks/installers/installer.ts | 8 ++++++-- src/tasks/installers/olm.ts | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tasks/installers/installer.ts b/src/tasks/installers/installer.ts index 6e5cdc32a..4bf0ba335 100644 --- a/src/tasks/installers/installer.ts +++ b/src/tasks/installers/installer.ts @@ -89,7 +89,7 @@ export class InstallerTasks { // let task: Listr.ListrTask - if (flags.installer === 'operator' || flags.installer === 'olm') { + if (flags.installer === 'operator') { title = '🏃‍ Running the Eclipse Che operator' task = () => { // The operator installs Eclipse Che in multiuser mode by default @@ -99,9 +99,13 @@ export class InstallerTasks { return operatorTasks.startTasks(flags, command) } - // installer.ts BEGIN CHE ONLY + // installer.ts BEGIN CHE ONLY } else if (flags.installer === 'olm') { title = '🏃‍ Running Olm installaion Eclipse Che' + // The olm installs Eclipse Che in multiuser mode by default + if (!flags.multiuser) { + flags.multiuser = true + } task = () => olmTasks.startTasks(flags, command) } else if (flags.installer === 'helm') { title = '🏃‍ Running Helm to install Eclipse Che' diff --git a/src/tasks/installers/olm.ts b/src/tasks/installers/olm.ts index d064a0eff..898d0bae9 100644 --- a/src/tasks/installers/olm.ts +++ b/src/tasks/installers/olm.ts @@ -51,7 +51,6 @@ export class OLMTasks { { title: 'Configure context information', task: async (ctx: any, task: any) => { - // Todo: should we do check for installer openshift? flags.platform === 'crc' || flags.platform === 'openshift' ctx.defaultCatalogSourceNamespace = isKubernetesPlatformFamily(flags.platform) ? defaultOLMKubernetesNamespace : defaultOpenshiftMarketPlaceNamespace // catalog source name for stable Che version ctx.catalogSourceNameStable = isKubernetesPlatformFamily(flags.platform) ? 'operatorhubio-catalog' : 'community-operators'