Skip to content
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

Chectl should try to detect installed namespace for appropriate commands #21311

Closed
Tracked by #21395
amisevsk opened this issue Mar 29, 2022 · 2 comments
Closed
Tracked by #21395
Labels
area/chectl Issues related to chectl, the CLI of Che kind/enhancement A feature request - must adhere to the feature request template. severity/P2 Has a minor but important impact to the usage or development of the system.
Milestone

Comments

@amisevsk
Copy link
Contributor

Is your enhancement related to a problem? Please describe

Some commands, e.g. chectl server:logs require the -n, --chenamespace parameter if Che is installed in a non-default namespace. However, in many cases, it is possible to discover the installed namespace via the Kubernetes API (e.g. by listing all CheClusters).

❯ chectl server:logs
Eclipse Che logs will be available in '/tmp/chectl-logs/1648573985115'
› Current Kubernetes context: 'amisevsk-che/<snip>:6443/amisevsk'
  ✔ Verify Kubernetes API...OK (it's OpenShift)
  ✖ Verify if namespace 'eclipse-che' exists
    → The Kubernetes Namespace "eclipse-che" doesn't exist.

❯ kubectl get CheClusters --all-namespaces
NAMESPACE    NAME          AGE
dogfooding   eclipse-che   650d

Describe the solution you'd like

Since commands like chectl server:logs do not modify any resources on the cluster, they should automatically detect the namespace and report a useful message if this is not possible.

Describe alternatives you've considered

The error message should suggest using the -n parameter if it cannot find the installation in the default namespace.

Additional context

No response

@amisevsk amisevsk added kind/enhancement A feature request - must adhere to the feature request template. area/chectl Issues related to chectl, the CLI of Che labels Mar 29, 2022
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Mar 29, 2022
@tolusha
Copy link
Contributor

tolusha commented Mar 30, 2022

chectl server:logs -n <NAMESPACE> ?

@amisevsk
Copy link
Contributor Author

amisevsk commented Mar 30, 2022

chectl server:logs -n ?

That's one of the alternatives suggested, but as an inexperienced user, if Che is not installed in eclipse-che, the error message is just

  ✖ Verify if namespace 'eclipse-che' exists
    → The Kubernetes Namespace "eclipse-che" doesn't exist.
    Read logs
    Error: Command server:logs failed. Error log: /home/amisevsk/.cache/chectl/error.log. Eclipse Che logs: /tmp/chectl-logs/1648646484798.

Which is a little confusing. Maybe the following is easier to understand without referencing docs or help pages:

  ✖ Verify if namespace 'eclipse-che' exists
    → The Kubernetes Namespace "eclipse-che" doesn't exist. Use the -n parameter to specify namespace for Eclipse Che installation.
    Read logs
    Error: Command server:logs failed. Error log: /home/amisevsk/.cache/chectl/error.log. Eclipse Che logs: /tmp/chectl-logs/1648646484798.

It also means the documentation has to explicitly include "If Che is not installed in the default namespace, the -n parameter must be used to specify the installed namespace".

However, if we're making k8s API calls already, it's very easy to figure out this namespace automatically and not require -n in the first place.

@ibuziuk ibuziuk added severity/P2 Has a minor but important impact to the usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Apr 4, 2022
@tolusha tolusha mentioned this issue May 13, 2022
49 tasks
@tolusha tolusha closed this as completed May 23, 2022
@tolusha tolusha added this to the 7.49 milestone May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/chectl Issues related to chectl, the CLI of Che kind/enhancement A feature request - must adhere to the feature request template. severity/P2 Has a minor but important impact to the usage or development of the system.
Projects
None yet
Development

No branches or pull requests

4 participants