Skip to content

Commit

Permalink
Mention platform in installer flag description
Browse files Browse the repository at this point in the history
Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha committed Jul 21, 2020
1 parent d124005 commit b7719da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
5 changes: 3 additions & 2 deletions src/commands/server/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ export default class Start extends Command {
}),
installer: string({
char: 'a',
description: 'Installer type',
description: `Installer type.${isStableVersion({}) ? ' If not set, default is "olm" for OpenShift 4.x platform otherwise "operator".' : ''}`,
options: ['helm', 'operator', 'olm', 'minishift-addon'],
default: `${isStableVersion({}) ? '' : 'operator'}`,
}),
domain: string({
char: 'b',
Expand Down Expand Up @@ -199,6 +200,7 @@ export default class Start extends Command {

if (!flags.installer) {
await this.setDefaultInstaller(flags)
cli.info(`› Installer type is set to: '${flags.installer}'`)
}

if (!flags.templates) {
Expand Down Expand Up @@ -441,7 +443,6 @@ export default class Start extends Command {
flags.installer = 'olm'
} else {
flags.installer = 'operator'
cli.info(`› Installer type is set to: '${flags.installer}'`)
}
}
}
12 changes: 3 additions & 9 deletions src/commands/server/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default class Update extends Command {
static flags = {
installer: string({
char: 'a',
description: 'Installer type',
options: ['helm', 'operator', 'minishift-addon', 'olm'],
description: 'Installer type. If not set, default is autodetected depending on previous installation.',
options: ['operator', 'olm'],
}),
platform: string({
char: 'p',
Expand Down Expand Up @@ -75,24 +75,19 @@ export default class Update extends Command {
}

async checkIfInstallerSupportUpdating(flags: any) {
// matrix checks
if (!flags.installer) {
await this.setDefaultInstaller(flags)
cli.info(`› Installer type is set to: '${flags.installer}'`)
}

if (flags.installer === 'operator' || flags.installer === 'olm') {
// operator already supports updating
return
}

if (flags.installer === 'minishift-addon' || flags.installer === 'helm') {
this.error(`🛑 The specified installer ${flags.installer} does not support updating yet.`)
}
if (flags.installer === 'olm' && flags.platform === 'minishift') {
this.error(`🛑 The specified installer ${flags.installer} does not support Minishift`)
}

this.error(`🛑 Unknown installer ${flags.installer} is specified.`)
}

async run() {
Expand Down Expand Up @@ -186,6 +181,5 @@ export default class Update extends Command {
} catch {
flags.installer = 'operator'
}
cli.info(`› Installer type is set to: '${flags.installer}'`)
}
}
5 changes: 2 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1540,16 +1540,15 @@ ecc-jsbn@~0.1.1:

"eclipse-che-minishift@git://github.com/minishift/minishift#master":
version "0.0.0"
resolved "git://github.com/minishift/minishift#c50597deacee626c655d8207642b343ba10839c1"
resolved "git://github.com/minishift/minishift#015bd7f9ec73ff38bbd8e7faa66f9ab60c5cabf6"

"eclipse-che-operator@git://github.com/eclipse/che-operator#master":
version "0.0.0"
uid c4a3ff2480740190f97feb3e6c85029506561e8c
resolved "git://github.com/eclipse/che-operator#c4a3ff2480740190f97feb3e6c85029506561e8c"

"eclipse-che@git://github.com/eclipse/che#master":
version "0.0.0"
resolved "git://github.com/eclipse/che#7cf97838a4492f4b20327adf0cba5f4c8033fbd7"
resolved "git://github.com/eclipse/che#593f91515f368dc6d76e1f09113e4d61c562aa46"

editorconfig@^0.15.0:
version "0.15.3"
Expand Down

0 comments on commit b7719da

Please sign in to comment.