【the waiter】announcement:
Yaml to json
| | |
Function introduction
- Online yaml transfer to json
- Explanation: Since the child nodes of the yaml tree are stored in map during the conversion process, the order of the results obtained after conversion to json is out of order.
Example
apiVersion: v1
kind: Service
metadata:
name: test-k8s
spec:
selector:
app: test-k8s
type: ClusterIP
ports:
- port: 8080
targetPort: 8080
after treatment
{
"apiVersion": "v1",
"kind": "Service",
"metadata": {
"name": "test-k8s"
},
"spec": {
"ports": [
{
"port": 8080,
"targetPort": 8080
}
],
"selector": {
"app": "test-k8s"
},
"type": "ClusterIP"
}
}