Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use 'openshift-marketplace' for OpenShift platform familiy #700

Merged
merged 4 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/tasks/installers/common-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion src/tasks/installers/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
7 changes: 3 additions & 4 deletions src/tasks/installers/olm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -51,8 +51,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'

Expand Down Expand Up @@ -119,7 +118,7 @@ export class OLMTasks {
task.title = `${task.title}...done.`
}
},
createEclipeCheCluster(flags, kube)
createEclipseCheCluster(flags, kube)
], { renderer: flags['listr-renderer'] as any })
}

Expand Down
4 changes: 2 additions & 2 deletions src/tasks/installers/operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -140,7 +140,7 @@ export class OperatorTasks {
}
}
},
createEclipeCheCluster(flags, kube)
createEclipseCheCluster(flags, kube)
], { renderer: flags['listr-renderer'] as any })
}

Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down