diff --git a/README.md b/README.md index 76ffabd76..992e96feb 100644 --- a/README.md +++ b/README.md @@ -308,10 +308,10 @@ USAGE [--k8spoddownloadimagetimeout ] [--k8spoderrorrechecktimeout ] [-d ] [-p minikube|k8s|openshift|microk8s|docker-desktop|crc] [-b ] [--debug] [--che-operator-image ] [--che-operator-cr-yaml ] [--che-operator-cr-patch-yaml ] [--workspace-pvc-storage-class-name ] - [--skip-version-check] [--skip-cert-manager] [--skip-devworkspace-operator] [--skip-oidc-provider-check] - [--auto-update] [--starting-csv ] [--package-manifest-name ] [--catalog-source-yaml - --olm-channel ] [--catalog-source-name --catalog-source-namespace ] [--catalog-source-image - ] [--cluster-monitoring] [--telemetry on|off] [--skip-kubernetes-health-check] + [--skip-version-check] [--skip-cert-manager] [--skip-devworkspace-operator] [--auto-update] [--starting-csv ] + [--package-manifest-name ] [--catalog-source-yaml --olm-channel ] [--catalog-source-name + --catalog-source-namespace ] [--catalog-source-image ] [--cluster-monitoring] [--telemetry + on|off] [--skip-kubernetes-health-check] FLAGS -b, --domain= @@ -416,9 +416,6 @@ FLAGS --skip-kubernetes-health-check Skip Kubernetes health check - --skip-oidc-provider-check - Skip OIDC Provider check - --skip-version-check Skip minimal versions check. diff --git a/src/commands/server/deploy.ts b/src/commands/server/deploy.ts index 7a52c9bd8..2937d06bc 100644 --- a/src/commands/server/deploy.ts +++ b/src/commands/server/deploy.ts @@ -73,8 +73,6 @@ import { SKIP_DEV_WORKSPACE_FLAG, SKIP_KUBE_HEALTHZ_CHECK, SKIP_KUBE_HEALTHZ_CHECK_FLAG, - SKIP_OIDC_PROVIDER, - SKIP_OIDC_PROVIDER_FLAG, SKIP_VERSION_CHECK, SKIP_VERSION_CHECK_FLAG, STARTING_CSV, @@ -127,7 +125,6 @@ export default class Deploy extends Command { [SKIP_VERSION_CHECK_FLAG]: SKIP_VERSION_CHECK, [SKIP_CERT_MANAGER_FLAG]: SKIP_CERT_MANAGER, [SKIP_DEV_WORKSPACE_FLAG]: SKIP_DEV_WORKSPACE, - [SKIP_OIDC_PROVIDER_FLAG]: SKIP_OIDC_PROVIDER, [AUTO_UPDATE_FLAG]: AUTO_UPDATE, [STARTING_CSV_FLAG]: STARTING_CSV, [OLM_CHANNEL_FLAG]: OLM_CHANNEL, diff --git a/src/flags.ts b/src/flags.ts index c05f47727..7444c6ee0 100644 --- a/src/flags.ts +++ b/src/flags.ts @@ -43,12 +43,6 @@ export const LISTR_RENDERER = Flags.string({ hidden: true, }) -export const SKIP_OIDC_PROVIDER_FLAG = 'skip-oidc-provider-check' -export const SKIP_OIDC_PROVIDER = Flags.boolean({ - description: 'Skip OIDC Provider check', - default: false, -}) - export const SKIP_KUBE_HEALTHZ_CHECK_FLAG = 'skip-kubernetes-health-check' export const SKIP_KUBE_HEALTHZ_CHECK = Flags.boolean({ description: 'Skip Kubernetes health check', diff --git a/src/tasks/platform-tasks.ts b/src/tasks/platform-tasks.ts deleted file mode 100644 index 0601c8915..000000000 --- a/src/tasks/platform-tasks.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) 2019-2022 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ - -import * as Listr from 'listr' -import {CheCtlContext, OIDCContext} from '../context' -import {KubeClient} from '../api/kube-client' -import {PLATFORM_FLAG, SKIP_OIDC_PROVIDER_FLAG} from '../flags' -import {EclipseChe} from './installers/eclipse-che/eclipse-che' - -export namespace PlatformTasks { - export function getEnsureOIDCProviderInstalledTask(): Listr.ListrTask { - const flags = CheCtlContext.getFlags() - return { - title: 'Check if OIDC Provider installed', - enabled: () => !flags[SKIP_OIDC_PROVIDER_FLAG], - skip: () => { - if (flags[PLATFORM_FLAG] === 'minikube') { - return 'Dex will be automatically installed as OIDC Identity Provider' - } - }, - task: async (_ctx: any, task: any) => { - const kubeHelper = KubeClient.getInstance() - const apiServerPods = await kubeHelper.getPodListByLabel('kube-system', 'component=kube-apiserver') - for (const pod of apiServerPods) { - if (!pod.spec) { - continue - } - - for (const container of pod.spec.containers) { - if (container.command && container.command.some(value => value.includes(OIDCContext.ISSUER_URL)) && container.command.some(value => value.includes(OIDCContext.CLIENT_ID))) { - task.title = `${task.title}...[OK]` - return - } - - if (container.args && container.args.some(value => value.includes(OIDCContext.ISSUER_URL)) && container.args.some(value => value.includes(OIDCContext.CLIENT_ID))) { - task.title = `${task.title}...[OK]` - return - } - } - } - - task.title = `${task.title}...[Not Found]` - throw new Error(`API server is not configured with OIDC Identity Provider, see details ${EclipseChe.DOC_LINK_CONFIGURE_API_SERVER}. To bypass OIDC Provider check, use \'--skip-oidc-provider-check\' flag`) - }, - } - } -}