-
Notifications
You must be signed in to change notification settings - Fork 55
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
Added --output=json
flag to epinio namespace [list|show]
#2547
Added --output=json
flag to epinio namespace [list|show]
#2547
Conversation
Codecov ReportPatch coverage is
📢 Thoughts on this report? Let us know!. |
Great! |
Tested in branch and seems to be ok:
➜ epinio git:(2527-add-output-json-flag-to-epinio-namespace-command) ✗ epinio namespace show workspace -o json | jq
{
"meta": {
"name": "workspace",
"createdAt": "2023-09-05T13:43:02Z"
},
"apps": [
"testapp-cli"
],
"configurations": [
"xcfefa578ebf738cc24fe12a0f5a3-mysql"
]
➜ epinio git:(2527-add-output-json-flag-to-epinio-namespace-command) ✗ epinio namespace list workspace -o json | jq
[
{
"meta": {
"name": "ns-1",
"createdAt": "2023-09-05T14:00:35Z"
}
},
{
"meta": {
"name": "workspace",
"createdAt": "2023-09-05T13:43:02Z"
},
"apps": [
"testapp-cli"
],
"configurations": [
"xcfefa578ebf738cc24fe12a0f5a3-mysql"
]
}
]
@enrichman, the only thing I noted was a time difference between I am not sure if we want to do something about it or assume this output difference as ok. |
@mmartin24 I would say that is OK. As a user I'm expecting the |
Rechecked in
➜ epinio git:(main) ✗ epinio namespace list -o json | jq
[
{
"meta": {
"name": "ns-1",
"createdAt": "2023-09-20T13:21:36Z"
}
},
{
"meta": {
"name": "workspace",
"createdAt": "2023-09-20T11:59:06Z"
},
"configurations": [
"config-1",
"xcfefa578ebf738cc24fe12a0f5a3-mysql"
]
}
]
➜ epinio git:(main) ✗ epinio namespace show workspace -o json | jq
{
"meta": {
"name": "workspace",
"createdAt": "2023-09-20T11:59:06Z"
},
"configurations": [
"config-1",
"xcfefa578ebf738cc24fe12a0f5a3-mysql"
]
}
|
Sanity check on epinio git:(main) epinio namespace list -o json | jq
[
{
"meta": {
"name": "workspace",
"createdAt": "2023-09-25T10:06:13Z"
}
}
]
➜ epinio git:(main) epinio info
✔️ Epinio Environment
Platform: k3s
Kubernetes Version: v1.25.4+k3s1
Epinio Server Version: v1.10.0
Epinio Client Version: v1.10.0
|
--output
flag with JSON support for Epinio namespace list and show commands--output=json
flag to epinio namespace [list|show]
This PR adds the support for the JSON output in the
namespace list
andnamespace show
commands.When selected it will silence the warning version, and it will still output a user-readable error in case of failure. The exit code will be a non-zero though. Not sure if we should provide a JSON error as well instead of a plain text.
It also adds an
enumValue
flag that can be used to provide a flag with a fixed set of values, and its completion func.