1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

add examples

This commit is contained in:
Kelly Brazil
2020-02-03 21:38:21 -08:00
parent cbb92c1a95
commit c690e328f2
2 changed files with 102 additions and 14 deletions

View File

@ -11,16 +11,60 @@ Compatibility:
Examples: Examples:
$ cat example.yaml | jc --yaml -p $ cat istio-mtls-permissive.yaml
apiVersion: "authentication.istio.io/v1alpha1"
kind: "Policy"
metadata:
name: "default"
namespace: "default"
spec:
peers:
- mtls: {}
---
apiVersion: "networking.istio.io/v1alpha3"
kind: "DestinationRule"
metadata:
name: "default"
namespace: "default"
spec:
host: "*.default.svc.cluster.local"
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
$ cat istio-mtls-permissive.yaml | jc --yaml -p
[ [
{ {
"Description": "This is a YAML document", "apiVersion": "authentication.istio.io/v1alpha1",
"Number": 42 "kind": "Policy",
"metadata": {
"name": "default",
"namespace": "default"
}, },
{ "spec": {
"Description": "Yet Another YAML document" "peers": [
"Boolean": true {
"mtls": {}
}
]
} }
},
{
"apiVersion": "networking.istio.io/v1alpha3",
"kind": "DestinationRule",
"metadata": {
"name": "default",
"namespace": "default"
},
"spec": {
"host": "*.default.svc.cluster.local",
"trafficPolicy": {
"tls": {
"mode": "ISTIO_MUTUAL"
}
}
}
}
] ]
## info ## info

View File

@ -10,16 +10,60 @@ Compatibility:
Examples: Examples:
$ cat example.yaml | jc --yaml -p $ cat istio-mtls-permissive.yaml
apiVersion: "authentication.istio.io/v1alpha1"
kind: "Policy"
metadata:
name: "default"
namespace: "default"
spec:
peers:
- mtls: {}
---
apiVersion: "networking.istio.io/v1alpha3"
kind: "DestinationRule"
metadata:
name: "default"
namespace: "default"
spec:
host: "*.default.svc.cluster.local"
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
$ cat istio-mtls-permissive.yaml | jc --yaml -p
[ [
{ {
"Description": "This is a YAML document", "apiVersion": "authentication.istio.io/v1alpha1",
"Number": 42 "kind": "Policy",
"metadata": {
"name": "default",
"namespace": "default"
}, },
{ "spec": {
"Description": "Yet Another YAML document" "peers": [
"Boolean": true {
"mtls": {}
}
]
} }
},
{
"apiVersion": "networking.istio.io/v1alpha3",
"kind": "DestinationRule",
"metadata": {
"name": "default",
"namespace": "default"
},
"spec": {
"host": "*.default.svc.cluster.local",
"trafficPolicy": {
"tls": {
"mode": "ISTIO_MUTUAL"
}
}
}
}
] ]
""" """
import jc.utils import jc.utils