-
Notifications
You must be signed in to change notification settings - Fork 7
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(cluster): customisable context path #565
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,9 @@ const formatStatus = status => { | |
|
||
const run = async function (argv) { | ||
const clusters = await listClusters(argv) | ||
|
||
const anyCustomContext = clusters.some( | ||
cluster => cluster.contextPath !== '' | ||
) | ||
const table = new Table({ | ||
head: [ | ||
'Name', | ||
|
@@ -45,20 +47,22 @@ const run = async function (argv) { | |
'DHIS2 Version', | ||
'DB Version', | ||
'Status', | ||
], | ||
].concat(anyCustomContext ? 'Context Path' : []), | ||
}) | ||
|
||
await Promise.all( | ||
clusters.map(async cluster => { | ||
const status = await getStatus(cluster) | ||
table.push([ | ||
chalk.blue(cluster.name), | ||
cluster.port, | ||
cluster.channel, | ||
cluster.dhis2Version, | ||
cluster.dbVersion, | ||
formatStatus(status), | ||
]) | ||
table.push( | ||
[ | ||
chalk.blue(cluster.name), | ||
cluster.port, | ||
cluster.channel, | ||
cluster.dhis2Version, | ||
cluster.dbVersion, | ||
formatStatus(status), | ||
].concat(anyCustomContext ? cluster.contextPath : []) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you think we should show this regardless of any set custom-context, I agree, we should probably do that. Or do you mean we should show '/' instead of an empty cell for non-custom contexts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean we should show |
||
) | ||
}) | ||
) | ||
|
||
|
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.
Should we just always show the context, even if none are custom?
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.
We could. The idea was that this is most likely not relevant to most users. I think very few are actually using this context-path, and it might be confusing if you don't know what it does?
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.
I could go either way here... I also think it would be confusing if
d2 cluster list
sometimes renders in a different format if you happen to have a custom context on one cluster you're running. It would make any kind of parsing of the output difficult as well, though we're not exactly well setup for that as it is