Does the following configuration for configMap create the test.json file of type empty array
or string []
kind: ConfigMap
apiVersion: v1
metadata:
name: myconfigmap
data:
test.json: |-
[]
The convertor to JSON suggests string:
{
"kind": "ConfigMap",
"apiVersion": "v1",
"metadata": {
"name": "myconfigmap"
},
"data": {
"test.json": "[]"
}
}
My goal is to create configMap file with empty array.
Sure, you can make it whatever string you want, it just has to be a string. The thing you can't do is test.json: []
since that's an array. The fact that your string happens to be valid JSON is not something K8s knows or cares about.