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

feat: detect nativeUserMode will be enabled so don't wait for keycloak #1502

Merged
merged 3 commits into from
Aug 5, 2021
Merged
Changes from 1 commit
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
9 changes: 7 additions & 2 deletions src/tasks/installers/common-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { CheGithubClient } from '../../api/github-client'
import { KubeHelper } from '../../api/kube'
import { VersionHelper } from '../../api/version'
import { CHE_CLUSTER_CRD, DOCS_LINK_IMPORT_CA_CERT_INTO_BROWSER, OPERATOR_TEMPLATE_DIR } from '../../constants'
import { getProjectVersion } from '../../util'
import { getProjectVersion, isOpenshiftPlatformFamily } from '../../util'

export function createNamespaceTask(namespaceName: string, labels: {}): Listr.ListrTask {
return {
Expand Down Expand Up @@ -141,7 +141,7 @@ export function createEclipseCheCluster(flags: any, kube: KubeHelper): Listr.Lis
const cheClusterCR = ctx.customCR || ctx.defaultCR
const cr = await kube.createCheCluster(cheClusterCR, flags, ctx, !ctx.customCR)

ctx.isKeycloakReady = ctx.isKeycloakReady || cr.spec.auth.externalIdentityProvider || cr.spec.auth.nativeUserMode
ctx.isKeycloakReady = ctx.isKeycloakReady || shouldNotDeployKeycloak(flags, cr)
ctx.isPostgresReady = ctx.isPostgresReady || cr.spec.database.externalDb
ctx.isDevfileRegistryReady = ctx.isDevfileRegistryReady || cr.spec.server.externalDevfileRegistry
ctx.isPluginRegistryReady = ctx.isPluginRegistryReady || cr.spec.server.externalPluginRegistry
Expand All @@ -155,6 +155,11 @@ export function createEclipseCheCluster(flags: any, kube: KubeHelper): Listr.Lis
}
}

function shouldNotDeployKeycloak(flags: any, cr: any): boolean {
return cr.spec.auth.externalIdentityProvider || cr.spec.auth.nativeUserMode ||
(isOpenshiftPlatformFamily(flags.platform) && cr.spec.devWorkspace.enable)
}

sparkoo marked this conversation as resolved.
Show resolved Hide resolved
/**
* Update CheCluster CR object using CR patch file.
* Clean up custom images if they weren't defined in the CR patch file to prevent update failing.
Expand Down