-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support to install che using stable-all-namespaces olm channel #1478
Conversation
79cda22
to
95829c0
Compare
src/tasks/installers/olm.ts
Outdated
await kube.deleteOperatorSubscription(SUBSCRIPTION_NAME, flags.chenamespace) | ||
task: async (ctx: any, task: any) => { | ||
const checlusters = await kube.getAllCheClusters() | ||
if (kube.operatorSubscriptionExists(SUBSCRIPTION_NAME, DEFAULT_OPENSHIFT_OPERATORS_NS_NAME) && checlusters.length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kube.operatorSubscriptionExists(SUBSCRIPTION_NAME, DEFAULT_OPENSHIFT_OPERATORS_NS_NAME) && checlusters.length === 0
Maybe this check should be moved to the separated method, cause it was used not once?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls revert
src/tasks/installers/olm.ts
Outdated
task: async (ctx: any, task: any) => { | ||
const checlusters = await kube.getAllCheClusters() | ||
if (kube.operatorSubscriptionExists(SUBSCRIPTION_NAME, DEFAULT_OPENSHIFT_OPERATORS_NS_NAME) && checlusters.length === 0) { | ||
await kube.deleteOperatorSubscription(SUBSCRIPTION_NAME, ctx.operatorNamespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but you completely removed case with delete operator subscription for one specific namespace. And the same for Delete(OLM) Eclipse Che cluster service versions
a817d95
to
fcd4a21
Compare
src/commands/server/deploy.ts
Outdated
@@ -296,6 +296,10 @@ export default class Deploy extends Command { | |||
this.error(`🛑 The specified installer ${flags.installer} does not support Minishift`) | |||
} | |||
|
|||
if (flags['olm-channel'] === STABLE_ALL_NAMESPACES_CHANNEL_NAME && (flags.platform === 'minikube' || flags.platform === 'k8s')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (flags['olm-channel'] === STABLE_ALL_NAMESPACES_CHANNEL_NAME && (flags.platform === 'minikube' || flags.platform === 'k8s')) { | |
if (flags['olm-channel'] === STABLE_ALL_NAMESPACES_CHANNEL_NAME && isKubernetesPlatformFamily(flags.platform)) { |
f619c9f
to
954a3e5
Compare
src/tasks/installers/olm.ts
Outdated
@@ -68,6 +68,8 @@ export class OLMTasks { | |||
}, | |||
{ | |||
title: 'Create operator group', | |||
// Not need it to create operator group in openshift-operators ns | |||
enabled: () => flags['olm-channel'] !== STABLE_ALL_NAMESPACES_CHANNEL_NAME, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check operator namespace (adjust comment as well)
src/tasks/installers/olm.ts
Outdated
task.title = `${task.title}...done.` | ||
}, | ||
}, | ||
{ | ||
title: 'Set custom operator image', | ||
enabled: () => flags['che-operator-image'], | ||
task: async (_ctx: any, task: any) => { | ||
const csvList = await kube.getClusterServiceVersions(flags.chenamespace) | ||
const csvList = await kube.getClusterServiceVersions(flags.chenamespaces) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo ?
src/tasks/installers/olm.ts
Outdated
} else if (VersionHelper.isDeployingStableVersion(flags) || flags['olm-channel'] === OLM_STABLE_CHANNEL_NAME) { | ||
// stable Che CatalogSource | ||
subscription = this.constructSubscription(SUBSCRIPTION_NAME, DEFAULT_CHE_OLM_PACKAGE_NAME, flags.chenamespace, ctx.defaultCatalogSourceNamespace, OLM_STABLE_CHANNEL_NAME, ctx.catalogSourceNameStable, ctx.approvalStarategy, ctx.startingCSV) | ||
subscription = this.constructSubscription(SUBSCRIPTION_NAME, DEFAULT_CHE_OLM_PACKAGE_NAME, ctx.operatorNamespace, ctx.defaultCatalogSourceNamespace, OLM_STABLE_CHANNEL_NAME, ctx.catalogSourceNameStable, ctx.approvalStarategy, ctx.startingCSV) | ||
} else if (flags['olm-channel'] === STABLE_ALL_NAMESPACES_CHANNEL_NAME && isOpenshiftPlatformFamily(flags.platform)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else if (flags['olm-channel'] === STABLE_ALL_NAMESPACES_CHANNEL_NAME && isOpenshiftPlatformFamily(flags.platform)) { | |
} else if (flags['olm-channel'] === STABLE_ALL_NAMESPACES_CHANNEL_NAME) { |
We already checked it in deploy command
Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
/retest |
1 similar comment
/retest |
src/tasks/installers/olm.ts
Outdated
ctx.operatorNamespace = DEFAULT_OPENSHIFT_OPERATORS_NS_NAME | ||
task.title = `${task.title}...Found` | ||
} | ||
ctx.operatorNamespace = flags.chenamespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.operatorNamespace = flags.chenamespace | |
ctx.operatorNamespace = flags.chenamespace || DEFAULT_CHE_NAMESPACE |
task: async (ctx: any, task: any) => { | ||
if (await kube.operatorSubscriptionExists(SUBSCRIPTION_NAME, DEFAULT_OPENSHIFT_OPERATORS_NS_NAME)) { | ||
ctx.operatorNamespace = DEFAULT_OPENSHIFT_OPERATORS_NS_NAME | ||
task.title = `${task.title}...Found` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return
or else
src/tasks/installers/olm.ts
Outdated
await kube.deleteOperatorSubscription(SUBSCRIPTION_NAME, flags.chenamespace) | ||
task: async (ctx: any, task: any) => { | ||
const checlusters = await kube.getAllCheClusters() | ||
if (kube.operatorSubscriptionExists(SUBSCRIPTION_NAME, DEFAULT_OPENSHIFT_OPERATORS_NS_NAME) && checlusters.length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls revert
Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: flacatus, tolusha The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
New changes are detected. LGTM label has been removed. |
Codecov Report
@@ Coverage Diff @@
## main #1478 +/- ##
=======================================
Coverage 10.85% 10.85%
=======================================
Files 63 63
Lines 6504 6521 +17
Branches 1096 1102 +6
=======================================
+ Hits 706 708 +2
- Misses 5798 5813 +15
Continue to review full report at Codecov.
|
Signed-off-by: Flavius Lacatusu flacatus@redhat.com
What does this PR do?
Add support for stable-all-namespaces channel.
eclipse-che/che-operator#890
Screenshot/screencast of this PR
What issues does this PR fix or reference?
Issue: eclipse-che/che#19891
How to test this PR?
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.