From 2d418f5c3787a145b22aaac5cdfb022952295e45 Mon Sep 17 00:00:00 2001 From: Mykola Morhun Date: Wed, 1 Apr 2020 10:41:31 +0300 Subject: [PATCH] Clarify '--domain' parameter in server:start command Signed-off-by: Mykola Morhun --- README.md | 6 ++++++ src/commands/server/start.ts | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a9b631c4e..788e0c590 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,12 @@ OPTIONS -b, --domain=domain Domain of the Kubernetes cluster (e.g. example.k8s-cluster.com or .nip.io) + This flag makes sense only for Kubernetes family infrastructures and will be autodetected for + Minikube and MicroK8s in most cases. + However, for Kubernetes cluster it is required to specify. + Please note, that just setting this flag will not likely work out of the box. + According changes should be done in Kubernetes cluster configuration as well. + In case of Openshift, domain adjustment should be done on the cluster configuration level. -d, --directory=directory Directory to store logs into diff --git a/src/commands/server/start.ts b/src/commands/server/start.ts index d2e77f34a..c4247b3ee 100644 --- a/src/commands/server/start.ts +++ b/src/commands/server/start.ts @@ -22,6 +22,7 @@ import { CheTasks } from '../../tasks/che' import { InstallerTasks } from '../../tasks/installers/installer' import { ApiTasks } from '../../tasks/platforms/api' import { PlatformTasks } from '../../tasks/platforms/platform' +import { isOpenshiftPlatformFamily } from '../../util' export default class Start extends Command { static description = 'start Eclipse Che server' @@ -100,7 +101,12 @@ export default class Start extends Command { }), domain: string({ char: 'b', - description: 'Domain of the Kubernetes cluster (e.g. example.k8s-cluster.com or .nip.io)', + description: `Domain of the Kubernetes cluster (e.g. example.k8s-cluster.com or .nip.io) + This flag makes sense only for Kubernetes family infrastructures and will be autodetected for Minikube and MicroK8s in most cases. + However, for Kubernetes cluster it is required to specify. + Please note, that just setting this flag will not likely work out of the box. + According changes should be done in Kubernetes cluster configuration as well. + In case of Openshift, domain adjustment should be done on the cluster configuration level.`, default: '' }), debug: boolean({ @@ -214,6 +220,10 @@ export default class Start extends Command { } } + if (flags.domain && !flags['che-operator-cr-yaml'] && isOpenshiftPlatformFamily(flags.platform)) { + this.warn('"--domain" flag is ignored for Openshift family infrastructures. It should be done on the cluster level.') + } + if (flags.installer) { if (flags.installer === 'minishift-addon') { if (flags.platform !== 'minishift') {