/kind feature
synopsis: ksonnet can render output as a text table. Add the ability to render this as JSON as well.
Why?
ksonnet can interact with other tools in a better fashion if it can output data in an easily parseable format. Bonus points if the format can be applied to multiple types of outputs and can signal the consumer of the incoming contents.
$ ks module list
MODULE
======
/
a
a.b
and as JSON ks module list -o json
{
"kind": "moduleList",
"data": [
{"module": "/"},
{"module": "a"},
{"module": "a.b"}
]
}
And with more than one column
$ ks component list -o wide
COMPONENT TYPE APIVERSION KIND NAME
========= ==== ========== ==== ====
deployment-nginx-deployment-yrbfz yaml apps/v1beta1 Deployment nginx-deployment
ds jsonnet
and as JSON ks component list -o json
{
"kind": "componentList",
"data": [
{
"component": "deployment-nginx-deployment-yrbfz",
"type": "yaml",
"apiversion": "apps/v1beta",
"kind": "Deployment",
"name": "nginx-deployment"
},
{
"component": "ds",
"type": "jsonnet",
"apiversion": "",
"kind": "",
"name": ""
}
]
}
Actions with outputs
Other actions: