From 2f9f01b080b7b592069b630a8baad42dc6851fd2 Mon Sep 17 00:00:00 2001 From: Mykola Morhun Date: Wed, 5 Feb 2020 12:46:09 +0200 Subject: [PATCH] Fixes according to review Signed-off-by: Mykola Morhun --- src/api/kube.ts | 4 ++-- src/api/typings/cert-manager.d.ts | 10 +++++----- src/commands/workspace/start.ts | 2 +- src/tasks/che.ts | 2 +- src/tasks/component-installers/cert-manager.ts | 7 ++++--- templates/cert-manager/che-cluster-issuer.yml | 8 ++++---- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/api/kube.ts b/src/api/kube.ts index 6ff2666b6..06059d7b3 100644 --- a/src/api/kube.ts +++ b/src/api/kube.ts @@ -22,7 +22,7 @@ import { Writable } from 'stream' import { DEFAULT_CHE_IMAGE } from '../constants' -import { V1alpha2Sertificate } from './typings/cert-manager' +import { V1alpha2Certificate } from './typings/cert-manager' const AWAIT_TIMEOUT_S = 30 @@ -1238,7 +1238,7 @@ export class KubeHelper { async createCheClusterCertificate(certificateTemplatePath: string, domain: string, namespace: string): Promise { const customObjectsApi = this.kc.makeApiClient(CustomObjectsApi) - const certifiate = this.safeLoadFromYamlFile(certificateTemplatePath) as V1alpha2Sertificate + const certifiate = this.safeLoadFromYamlFile(certificateTemplatePath) as V1alpha2Certificate const CN = '*.' + domain certifiate.spec.commonName = CN diff --git a/src/api/typings/cert-manager.d.ts b/src/api/typings/cert-manager.d.ts index 0ec8996f2..b6a287515 100644 --- a/src/api/typings/cert-manager.d.ts +++ b/src/api/typings/cert-manager.d.ts @@ -8,21 +8,21 @@ * SPDX-License-Identifier: EPL-2.0 **********************************************************************/ -export interface V1alpha2Sertificate { +export interface V1alpha2Certificate { apiVersion: string kind: string metadata: V1ObjectMeta - spec: V1alpha2SertificateSpec + spec: V1alpha2CertificateSpec } -export interface V1alpha2SertificateSpec { +export interface V1alpha2CertificateSpec { secretName: string - issuerRef: V1alpha2SertificateSpecIssuerRrederence + issuerRef: V1alpha2CertificateSpecIssuerReference commonName: string dnsNames: List } -export interface V1alpha2SertificateSpecIssuerRrederence { +export interface V1alpha2CertificateSpecIssuerReference { name: string kind: string } diff --git a/src/commands/workspace/start.ts b/src/commands/workspace/start.ts index f9a71f91d..2a32684f4 100644 --- a/src/commands/workspace/start.ts +++ b/src/commands/workspace/start.ts @@ -60,7 +60,7 @@ export default class Start extends Command { title: 'Retrieving Eclipse Che Server URL', task: async (ctx: any, task: any) => { ctx.cheURL = await che.cheURL(flags.chenamespace) - task.title = await `${task.title}...${ctx.cheURL}` + task.title = await `${task.title}... ${ctx.cheURL}` } }, { diff --git a/src/tasks/che.ts b/src/tasks/che.ts index 7ad491570..4158b05ed 100644 --- a/src/tasks/che.ts +++ b/src/tasks/che.ts @@ -94,7 +94,7 @@ export class CheTasks { title: 'Retrieving Eclipse Che Server URL', task: async (ctx: any, task: any) => { ctx.cheURL = await this.che.cheURL(flags.chenamespace) - task.title = await `${task.title}...${ctx.cheURL}` + task.title = await `${task.title}... ${ctx.cheURL}` } }, { diff --git a/src/tasks/component-installers/cert-manager.ts b/src/tasks/component-installers/cert-manager.ts index 1dd5f02b0..8cb8f54bb 100644 --- a/src/tasks/component-installers/cert-manager.ts +++ b/src/tasks/component-installers/cert-manager.ts @@ -61,9 +61,10 @@ export class CertManagerTasks { throw new Error('Cert Manager should be deployed before.') } - await this.kubeHelper.waitForPodReady('app.kubernetes.io/name=cert-manager', CERT_MANAGER_NAMESPACE_NAME) - await this.kubeHelper.waitForPodReady('app.kubernetes.io/name=webhook', CERT_MANAGER_NAMESPACE_NAME) - await this.kubeHelper.waitForPodReady('app.kubernetes.io/name=cainjector', CERT_MANAGER_NAMESPACE_NAME) + const timeout = 5 * 60 * 1000 + await this.kubeHelper.waitForPodReady('app.kubernetes.io/name=cert-manager', CERT_MANAGER_NAMESPACE_NAME, 1000, timeout) + await this.kubeHelper.waitForPodReady('app.kubernetes.io/name=webhook', CERT_MANAGER_NAMESPACE_NAME, 1000, timeout) + await this.kubeHelper.waitForPodReady('app.kubernetes.io/name=cainjector', CERT_MANAGER_NAMESPACE_NAME, 1000, timeout) task.title = `${task.title}...ready` } diff --git a/templates/cert-manager/che-cluster-issuer.yml b/templates/cert-manager/che-cluster-issuer.yml index 1f24fc801..488fdb082 100644 --- a/templates/cert-manager/che-cluster-issuer.yml +++ b/templates/cert-manager/che-cluster-issuer.yml @@ -2,8 +2,8 @@ apiVersion: cert-manager.io/v1alpha2 kind: ClusterIssuer metadata: - name: che-cluster-issuer - namespace: cert-manager + name: che-cluster-issuer + namespace: cert-manager spec: - ca: - secretName: ca + ca: + secretName: ca