Skip to content

Commit

Permalink
Recreate Che operator group on restore
Browse files Browse the repository at this point in the history
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
  • Loading branch information
mmorhun committed Oct 4, 2021
1 parent 48a578b commit 14a68ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/commands/server/restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { cheNamespace } from '../../common-flags'
import { getBackupServerConfigurationName, parseBackupServerConfig, requestRestore } from '../../api/backup-restore'
import { cli } from 'cli-ux'
import { ApiTasks } from '../../tasks/platforms/api'
import { TASK_TITLE_CREATE_CUSTOM_CATALOG_SOURCE_FROM_FILE, TASK_TITLE_DELETE_CUSTOM_CATALOG_SOURCE, TASK_TITLE_DELETE_NIGHTLY_CATALOG_SOURCE, TASK_TITLE_DELETE_OPERATOR_GROUP, OLMTasks, TASK_TITLE_SET_CUSTOM_OPERATOR_IMAGE, TASK_TITLE_PREPARE_CHE_CLUSTER_CR } from '../../tasks/installers/olm'
import { TASK_TITLE_CREATE_CUSTOM_CATALOG_SOURCE_FROM_FILE, TASK_TITLE_DELETE_CUSTOM_CATALOG_SOURCE, TASK_TITLE_DELETE_NIGHTLY_CATALOG_SOURCE, OLMTasks, TASK_TITLE_SET_CUSTOM_OPERATOR_IMAGE, TASK_TITLE_PREPARE_CHE_CLUSTER_CR } from '../../tasks/installers/olm'
import { OperatorTasks } from '../../tasks/installers/operator'
import { checkChectlAndCheVersionCompatibility, downloadTemplates, TASK_TITLE_CREATE_CHE_CLUSTER_CRD, TASK_TITLE_PATCH_CHECLUSTER_CR } from '../../tasks/installers/common-tasks'
import { confirmYN, findWorkingNamespace, getCommandSuccessMessage, getEmbeddedTemplatesDirectory, notifyCommandCompletedSuccessfully, wrapCommandError } from '../../util'
Expand Down Expand Up @@ -365,7 +365,6 @@ export default class Restore extends Command {
const olmTasks = new OLMTasks()
let olmDeleteTasks = olmTasks.deleteTasks(flags)
const tasksToDelete = [
TASK_TITLE_DELETE_OPERATOR_GROUP,
TASK_TITLE_DELETE_CUSTOM_CATALOG_SOURCE,
TASK_TITLE_DELETE_NIGHTLY_CATALOG_SOURCE,
]
Expand Down
3 changes: 1 addition & 2 deletions src/tasks/installers/olm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const TASK_TITLE_SET_CUSTOM_OPERATOR_IMAGE = 'Set custom operator image'
export const TASK_TITLE_CREATE_CUSTOM_CATALOG_SOURCE_FROM_FILE = 'Create custom catalog source from file'
export const TASK_TITLE_PREPARE_CHE_CLUSTER_CR = 'Prepare Eclipse Che cluster CR'

export const TASK_TITLE_DELETE_OPERATOR_GROUP = 'Delete(OLM) operator group'
export const TASK_TITLE_DELETE_CUSTOM_CATALOG_SOURCE = `Delete(OLM) custom catalog source ${CUSTOM_CATALOG_SOURCE_NAME}`
export const TASK_TITLE_DELETE_NIGHTLY_CATALOG_SOURCE = `Delete(OLM) nigthly catalog source ${NEXT_CATALOG_SOURCE_NAME}`

Expand Down Expand Up @@ -380,7 +379,7 @@ export class OLMTasks {
},
},
{
title: TASK_TITLE_DELETE_OPERATOR_GROUP,
title: 'Delete(OLM) operator group',
// Do not delete global operator group if operator is in all namespaces mode
enabled: ctx => ctx.isPreInstalledOLM && ctx.operatorNamespace !== DEFAULT_OPENSHIFT_OPERATORS_NS_NAME,
task: async (ctx: any, task: any) => {
Expand Down

0 comments on commit 14a68ae

Please sign in to comment.