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

feat: Create new chectl command -> server:status #870

Merged
merged 7 commits into from
Sep 29, 2020
Merged

feat: Create new chectl command -> server:status #870

merged 7 commits into from
Sep 29, 2020

Conversation

flacatus
Copy link
Collaborator

@flacatus flacatus commented Sep 22, 2020

Signed-off-by: Flavius Lacatusu [email protected]

What does this PR do?

This PR add a new command to chectl which prints some information about che instance: if Openshift Oauth is enabled, version, che url or how many workspaces exist.
Also this PR rename the variable of minishift e2e job (GITHUBTOKEN--> GITHUB_TOKEN)

What issues does this PR fix or reference?

eclipse-che/che#14476

@flacatus
Copy link
Collaborator Author

Hi. About print the info aligned in bash terminal I found only this way: https://github.com/che-incubator/chectl/pull/870/files#diff-460d15365f3c03a6a088ecdc731b0b0eR66-R69. If someone know a better approach, Will be a pleasure to add it in my PR.

@flacatus
Copy link
Collaborator Author

The current output it is:
image

Signed-off-by: Flavius Lacatusu <[email protected]>
Signed-off-by: Flavius Lacatusu <[email protected]>
@AndrienkoAleksandr
Copy link
Contributor

Hi. About print the info aligned in bash terminal I found only this way: https://github.com/che-incubator/chectl/pull/870/files#diff-460d15365f3c03a6a088ecdc731b0b0eR66-R69. If someone know a better approach, Will be a pleasure to add it in my PR.

You can try to use cli-table from https://github.com/oclif/cli-ux
https://github.com/che-incubator/chectl/blob/master/src/commands/workspace/list.ts#L65

@flacatus
Copy link
Collaborator Author

I've tried cli.table but prints only in columns from what I see in https://github.com/oclif/cli-ux#clitable

@AndrienkoAleksandr
Copy link
Contributor

const columns: Table.Columns = {
  // where `.name` is a property of a data object
  name: {}, // "Name" inferred as the column header
  id: {
    header: 'ID', // override column header
    minWidth: '10', // column must display at this width or greater
    extended: true, // only display this column when the --extended flag is present
    get: row => `US-O1-${row.id}`, // custom getter for data row object
  },
}

Maybe you should try to use:
get: row => US-O1-${row.id}, // custom getter for data row object

@flacatus
Copy link
Collaborator Author

I've tried that as well but the output still be:
image

Signed-off-by: Flavius Lacatusu <[email protected]>
@tolusha
Copy link
Collaborator

tolusha commented Sep 22, 2020

In general the only flag is accepted is -n.
This command is supposed to be run by user who has cluster admin rights.

  1. Is it possible to get che version without making request? if no, let's print che-server image
  2. OpenShift OAuth enabled we have to analyze CR (if exists) to check if server.auth.openShiftoAuth is set and print yes/no

@flacatus
Copy link
Collaborator Author

@tolusha It is possible to get che version from CR... In case of nightly deployments(7.19.0-SNAPSHOT) will print only nightly.

@tolusha
Copy link
Collaborator

tolusha commented Sep 22, 2020

inside che-server pod:
cat /home/user/eclipse-che/tomcat/webapps/ROOT/META-INF/MANIFEST.MF

...
Implementation-Vendor: Red Hat, Inc.
Implementation-Version: 7.19.0-SNAPSHOT
...

@tolusha
Copy link
Collaborator

tolusha commented Sep 22, 2020

without access-token it is not possible to get list of workspaces, so let's remove this info.
workspace:list command exists for this case.

src/commands/server/status.ts Outdated Show resolved Hide resolved
src/commands/server/status.ts Outdated Show resolved Hide resolved
Signed-off-by: Flavius Lacatusu <[email protected]>
src/api/version.ts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@flacatus flacatus requested a review from mmorhun September 28, 2020 09:34
Signed-off-by: Flavius Lacatusu <[email protected]>
Signed-off-by: Flavius Lacatusu <[email protected]>
@flacatus flacatus merged commit cfd23c5 into che-incubator:master Sep 29, 2020
@che-bot che-bot added this to the 7.20 milestone Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants