jq -cでやる
1 |
cat tmp.yaml | yq |
このようなjson
1 2 3 4 5 6 7 |
{ "apiVersion": "v1", "kind": "ConfigMap", "data": { "mapUsers": "- userarn: arn:aws:iam::XXXXXXXXXXXX:user/admin\n username: admin\n groups:\n - system:masters\n" } } |
1 2 |
cat tmp.yaml | yq | jq -c {"apiVersion":"v1","kind":"ConfigMap","data":{"mapUsers":"- userarn: arn:aws:iam::XXXXXXXXXXXX:user/admin\n username: admin\n groups:\n - system:masters\n"}} |