Skip to content

Commit

Permalink
Add fix instructions into error message for Helm installer
Browse files Browse the repository at this point in the history
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
  • Loading branch information
mmorhun committed Apr 30, 2020
1 parent 21a4779 commit 0c7ca12
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tasks/installers/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ export class HelmTasks {
task: async (ctx: any, task: any) => {
const cheTlsSecret = await this.kubeHelper.getSecret(CHE_TLS_SECRET_NAME, flags.chenamespace)

const fixErrorMessage = 'Helm installer generates secrets automatically. To fix the problem delete existed secrets in dedicated for Eclispe Che namespace and rerun the command.'
if (cheTlsSecret && cheTlsSecret.data) {
if (!cheTlsSecret.data['tls.crt'] || !cheTlsSecret.data['tls.key']) {
throw new Error('"che-tls" secret is found but it is invalid. The valid self-signed certificate should contain "tls.crt" and "tls.key" entries.')
throw new Error('"che-tls" secret is found but it is invalid. The valid self-signed certificate should contain "tls.crt" and "tls.key" entries. ' + fixErrorMessage)
}
if (flags['self-signed-cert'] && !cheTlsSecret.data['ca.crt']) {
throw new Error(`"ca.crt" should be present in ${CHE_TLS_SECRET_NAME} secret in case of using self-signed certificate with helm installer.`)
throw new Error(`"ca.crt" should be present in ${CHE_TLS_SECRET_NAME} secret in case of using self-signed certificate with helm installer. ${fixErrorMessage}`)
}

ctx.cheCertificateExists = true
Expand Down

0 comments on commit 0c7ca12

Please sign in to comment.