Skip to content

Commit

Permalink
refactor: Cleanup inconsistent labeling of Eclipse Che (#479)
Browse files Browse the repository at this point in the history
Signed-off-by: Mykhailo Kuznietsov <mkuznets@redhat.com>
  • Loading branch information
mkuznyetsov authored Feb 3, 2020
1 parent 9df482b commit d99cbde
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 69 deletions.
6 changes: 3 additions & 3 deletions src/api/che.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class CheHelper {
}

/**
* Finds a pod where Che workspace is running.
* Finds a pod where workspace is running.
* Rejects if no workspace is found for the given workspace ID
* or if workspace ID wasn't specified but more than one workspace is found.
*/
Expand All @@ -63,7 +63,7 @@ export class CheHelper {
if (wsPods.length === 1) {
return wsPods[0].metadata!.name!
}
throw new Error('More than one pod with running workspace is found. Please, specify Che Workspace ID.')
throw new Error('More than one pod with running workspace is found. Please, specify Workspace ID.')
}
}

Expand All @@ -88,7 +88,7 @@ export class CheHelper {
if (wsPods.length === 1) {
return wsPods[0].spec!.containers.map(c => c.name)
}
throw new Error('More than one pod with running workspace is found. Please, specify Che Workspace ID.')
throw new Error('More than one pod with running workspace is found. Please, specify Workspace ID.')
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/commands/devfile/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const EditorComponents = new Map<Editor, DevfileComponent>([
])

export default class Generate extends Command {
static description = 'generate and print a devfile to stdout given some Kubernetes resources and other Che workspaces features (project, language-support, commands etc...)'
static description = 'generate and print a devfile to stdout given some Kubernetes resources and other workspaces features (project, language-support, commands etc...)'

static flags = {
help: flags.help({ char: 'h' }),
Expand All @@ -58,7 +58,7 @@ export default class Generate extends Command {
required: false,
}),
editor: string({
description: `Specify the Che editor component. Currently supported editors: ${editors}`,
description: `Specify the editor component. Currently supported editors: ${editors}`,
env: 'EDITOR',
required: false,
}),
Expand Down
2 changes: 1 addition & 1 deletion src/commands/server/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { OperatorTasks } from '../../tasks/installers/operator'
import { K8sTasks } from '../../tasks/platforms/k8s'

export default class Delete extends Command {
static description = 'delete any Che related resource: Kubernetes/OpenShift/Helm'
static description = 'delete any Eclipse Che related resource: Kubernetes/OpenShift/Helm'

static flags = {
help: flags.help({ char: 'h' }),
Expand Down
12 changes: 6 additions & 6 deletions src/commands/server/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default class Start extends Command {
default: ''
}),
'os-oauth': flags.boolean({
description: 'Enable use of OpenShift credentials to log into Che',
description: 'Enable use of OpenShift credentials to log into Eclipse Che',
default: false
}),
'che-operator-image': string({
Expand Down Expand Up @@ -209,19 +209,19 @@ export default class Start extends Command {
// Platform Checks
let platformCheckTasks = new Listr(platformTasks.preflightCheckTasks(flags, this), listrOptions)

// Checks if Che is already deployed
// Checks if Eclipse Che is already deployed
let preInstallTasks = new Listr(undefined, listrOptions)
preInstallTasks.add(k8sTasks.testApiTasks(flags, this))
preInstallTasks.add({
title: '👀 Looking for an already existing Che instance',
title: '👀 Looking for an already existing Eclipse Che instance',
task: () => new Listr(cheTasks.checkIfCheIsInstalledTasks(flags, this))
})

Start.setPlaformDefaults(flags)
let installTasks = new Listr(installerTasks.installTasks(flags, this), listrOptions)

const startDeployedCheTasks = new Listr([{
title: '👀 Starting already deployed Che',
title: '👀 Starting already deployed Eclipse Che',
task: () => new Listr(cheTasks.scaleCheUpTasks(this))
}], listrOptions)

Expand Down Expand Up @@ -257,9 +257,9 @@ export default class Start extends Command {
|| (ctx.isPluginRegistryDeployed && !ctx.isPluginRegistryReady)
|| (ctx.isDevfileRegistryDeployed && !ctx.isDevfileRegistryReady)) {
if (flags.platform || flags.installer) {
this.warn('Deployed Che is found and the specified installation parameters will be ignored')
this.warn('Deployed Eclipse Che is found and the specified installation parameters will be ignored')
}
// perform Che start task if there is any component that is not ready
// perform Eclipse Che start task if there is any component that is not ready
await startDeployedCheTasks.run(ctx)
}

Expand Down
8 changes: 4 additions & 4 deletions src/commands/server/stop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class Stop extends Command {
chenamespace: cheNamespace,
'deployment-name': cheDeployment,
'che-selector': string({
description: 'Selector for Che Server resources',
description: 'Selector for Eclipse Che Server resources',
default: 'app=che,component=che',
env: 'CHE_SELECTOR'
}),
Expand Down Expand Up @@ -52,16 +52,16 @@ export default class Stop extends Command {
title: 'Deployment doesn\'t exist',
enabled: (ctx: any) => !ctx.isCheDeployed,
task: async () => {
await this.error(`E_BAD_DEPLOY - Deployment do not exist.\nA Deployment named "${flags['deployment-name']}" exist in namespace \"${flags.chenamespace}\", Che Server cannot be stopped.\nFix with: verify the namespace where Che is running (oc get projects)\nhttps://github.com/eclipse/che`, { code: 'E_BAD_DEPLOY' })
await this.error(`E_BAD_DEPLOY - Deployment do not exist.\nA Deployment named "${flags['deployment-name']}" exist in namespace \"${flags.chenamespace}\", Eclipse Che Server cannot be stopped.\nFix with: verify the namespace where Eclipse Che is running (oc get projects)\nhttps://github.com/eclipse/che`, { code: 'E_BAD_DEPLOY' })
}
},
{
title: 'Che server was already stopped',
title: 'Eclipse Che server was already stopped',
enabled: (ctx: any) => (ctx.isStopped),
task: async () => { }
},
{
title: 'Che server Pod is not ready. It may be failing to start. Skipping shutdown request',
title: 'Eclipse Che server Pod is not ready. It may be failing to start. Skipping shutdown request',
enabled: (ctx: any) => (ctx.isNotReadyYet),
task: async () => { }
}
Expand Down
8 changes: 4 additions & 4 deletions src/commands/server/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ export default class Update extends Command {

this.checkIfInstallerSupportUpdating(flags)

// Checks if Che is already deployed
// Checks if Eclipse Che is already deployed
let preInstallTasks = new Listr(undefined, listrOptions)
preInstallTasks.add(k8sTasks.testApiTasks(flags, this))
preInstallTasks.add({
title: '👀 Looking for an already existing Che instance',
title: '👀 Looking for an already existing Eclipse Che instance',
task: () => new Listr(cheTasks.checkIfCheIsInstalledTasks(flags, this))
})

Expand All @@ -130,9 +130,9 @@ export default class Update extends Command {
await preUpdateTasks.run(ctx)

if (!flags['skip-version-check']) {
await cli.anykey(` Found deployed Che with operator [${ctx.deployedCheOperatorImage}]:${ctx.deployedCheOperatorTag}.
await cli.anykey(` Found deployed Eclipse Che with operator [${ctx.deployedCheOperatorImage}]:${ctx.deployedCheOperatorTag}.
You are going to update it to [${ctx.newCheOperatorImage}]:${ctx.newCheOperatorTag}.
Note that che operator will update components images (che server, plugin registry) only if their values
Note that Che Operator will update components images (che server, plugin registry) only if their values
are not overridden in eclipse-che Customer Resource. So, you may need to remove them manually.
Press q to quit or any key to continue`)
}
Expand Down
4 changes: 2 additions & 2 deletions src/commands/workspace/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { cheNamespace, listrRenderer } from '../../common-flags'
import { CheTasks } from '../../tasks/che'

export default class Inject extends Command {
static description = 'inject configurations and tokens in a Che Workspace'
static description = 'inject configurations and tokens in a workspace'

static flags = {
help: flags.help({ char: 'h' }),
Expand All @@ -37,7 +37,7 @@ export default class Inject extends Command {
}),
container: string({
char: 'c',
description: 'Target container. If not specified, configuration files will be injected in all containers of a Che Workspace pod',
description: 'Target container. If not specified, configuration files will be injected in all containers of a workspace pod',
required: false
}),
'kube-context': string({
Expand Down
4 changes: 2 additions & 2 deletions src/commands/workspace/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Command, flags } from '@oclif/command'
import { accessToken, cheNamespace, listrRenderer } from '../../common-flags'

export default class List extends Command {
static description = 'list Che workspaces'
static description = 'list workspaces'

static flags = {
help: flags.help({ char: 'h' }),
Expand All @@ -28,7 +28,7 @@ export default class List extends Command {
const notifier = require('node-notifier')
const tasks = new Listr([
{ title: 'Verify if we can access Kubernetes API', skip: this.warn('Not implemented yet') },
{ title: 'Verify if Che is running', skip: this.warn('Not implemented yet') },
{ title: 'Verify if Eclipse Che is running', skip: this.warn('Not implemented yet') },
{ title: 'Get Workspaces', skip: this.warn('Not implemented yet') },
], { renderer: flags['listr-renderer'] as any })

Expand Down
10 changes: 5 additions & 5 deletions src/commands/workspace/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { cli } from 'cli-ux'
import { CheHelper } from '../../api/che'
import { accessToken, cheNamespace, listrRenderer } from '../../common-flags'
export default class Start extends Command {
static description = 'create and start a Che workspace'
static description = 'create and start a workspace'

static flags = {
help: flags.help({ char: 'h' }),
Expand All @@ -42,7 +42,7 @@ export default class Start extends Command {

async checkToken(flags: any, ctx: any) {
if (ctx.isAuthEnabled && !flags['access-token']) {
this.error('E_AUTH_REQUIRED - Che authentication is enabled and an access token need to be provided (flag --access-token).')
this.error('E_AUTH_REQUIRED - Eclipse Che authentication is enabled and an access token need to be provided (flag --access-token).')
}
}

Expand All @@ -57,17 +57,17 @@ export default class Start extends Command {
}
const tasks = new Listr([
{
title: 'Retrieving Che Server URL',
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}`
}
},
{
title: 'Verify if Che server is running',
title: 'Verify if Eclipse Che server is running',
task: async (ctx: any, task: any) => {
if (!await che.isCheServerReady(ctx.cheURL)) {
this.error(`E_SRV_NOT_RUNNING - Che Server is not available by ${ctx.cheURL}`, { code: 'E_SRV_NOT_RUNNNG' })
this.error(`E_SRV_NOT_RUNNING - Eclipse Che Server is not available by ${ctx.cheURL}`, { code: 'E_SRV_NOT_RUNNNG' })
}
const status = await che.getCheServerStatus(ctx.cheURL)
ctx.isAuthEnabled = await che.isAuthenticationEnabled(ctx.cheURL)
Expand Down
4 changes: 2 additions & 2 deletions src/commands/workspace/stop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Command, flags } from '@oclif/command'
import { accessToken, cheNamespace, listrRenderer } from '../../common-flags'

export default class Stop extends Command {
static description = 'stop a running Che workspace'
static description = 'stop a running workspace'

static flags = {
help: flags.help({ char: 'h' }),
Expand All @@ -28,7 +28,7 @@ export default class Stop extends Command {
const notifier = require('node-notifier')
const tasks = new Listr([
{ title: 'Verify if we can access Kubernetes API', skip: () => 'Not implemented yet', task: () => { } },
{ title: 'Verify if Che is responding', skip: () => 'Not implemented yet', task: () => { } },
{ title: 'Verify if Eclipse Che is responding', skip: () => 'Not implemented yet', task: () => { } },
{ title: 'Verify if the workspaces is running', skip: () => 'Not implemented yet', task: () => { } },
{ title: 'Stop the workspace', skip: () => 'Not implemented yet', task: () => { } },
{ title: 'Waiting for the workspace resources to be deleted', skip: () => 'Not implemented yet', task: () => { } },
Expand Down
6 changes: 3 additions & 3 deletions src/common-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import { string } from '@oclif/parser/lib/flags'

export const cheNamespace = string({
char: 'n',
description: 'Kubernetes namespace where Che server is supposed to be deployed',
description: 'Kubernetes namespace where Eclipse Che server is supposed to be deployed',
default: 'che',
env: 'CHE_NAMESPACE'
})

export const cheDeployment = string({
description: 'Che deployment name',
description: 'Eclipse Che deployment name',
default: 'che',
env: 'CHE_DEPLOYMENT'
})
Expand All @@ -29,6 +29,6 @@ export const listrRenderer = string({
})

export const accessToken = string({
description: 'Che OIDC Access Token',
description: 'Eclipse Che OIDC Access Token',
env: 'CHE_ACCESS_TOKEN'
})
Loading

0 comments on commit d99cbde

Please sign in to comment.