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: Inspect CheCluster for embedded plugin registry indicator #2861

Merged
merged 4 commits into from
Feb 22, 2024
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
1 change: 1 addition & 0 deletions src/api/types/che-cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface CheClusterSpec {

interface CheClusterPluginRegistryComponent {
disableInternalRegistry?: boolean
openVSXURL?: string
}

interface CheClusterDevfileRegistryComponent {
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/pod-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export namespace PodTasks {
const tasks = newListr([])
tasks.add(getSchedulingTask(selector, namespace))
tasks.add(getDownloadingTask(selector, namespace))
if (name === EclipseChe.PLUGIN_REGISTRY && await Che.isEmbeddedPluginRegistryConfigured(namespace)) {
if (name === EclipseChe.PLUGIN_REGISTRY && await Che.isEmbeddedOpenVSXRegistryConfigured(namespace)) {
// if embedded plugin registry is configured, use longer timeout for pod readiness
tasks.add(getStartingTask(selector, namespace, ctx[KubeHelperContext.POD_READY_TIMEOUT_EMBEDDED_PLUGIN_REGISTRY]))
} else {
Expand Down
7 changes: 4 additions & 3 deletions src/utils/che.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,10 @@ export namespace Che {
throw new Error(`Route ${EclipseChe.CHE_FLAVOR} not found`)
}

export async function isEmbeddedPluginRegistryConfigured(namespace: string): Promise<boolean> {
export async function isEmbeddedOpenVSXRegistryConfigured(namespace: string): Promise<boolean> {
const kubeClient = KubeClient.getInstance()
await kubeClient.waitConfigMap(EclipseChe.PLUGIN_REGISTRY_CONFIG_MAP, namespace)
return await kubeClient.getConfigMapValue(EclipseChe.PLUGIN_REGISTRY_CONFIG_MAP, namespace, 'START_OPENVSX') === 'true'
const cheCluster = await kubeClient.getCheCluster(namespace)

return !cheCluster?.spec?.components?.pluginRegistry?.openVSXURL
}
}
Loading