Hi there!
I'm facing a problem trying to import/export some data into etcd using etcdtool. Since lists are converted into json objects creating directories using the index as the key, when I load a json file with a list and then try to export the destination key, both json files differ.
Example:
# cat test.json
{
"mylist": [
{ "one": "uno"},
{"two": "dos"}
]
}
# ./etcdtool-3.4 --peers="https://myetcd:2379" import -y /test ./test.json
# ./etcdtool-3.4 --peers="https://myetcd:2379" export /test
{
"mylist": {
"0": {
"one": "uno"
},
"1": {
"two": "dos"
}
}
}
It would be great to export the directory so the resulting json file is the same that was loaded (expected behavior: when all the keys in a directory are whole numbers, then convert them into a list). Maybe it can be added as an optional parameter (e.g. --keep-lists)?.
Hi there!
I'm facing a problem trying to import/export some data into etcd using etcdtool. Since lists are converted into json objects creating directories using the index as the key, when I load a json file with a list and then try to export the destination key, both json files differ.
Example: # cat test.json { "mylist": [ { "one": "uno"}, {"two": "dos"} ] } # ./etcdtool-3.4 --peers="https://myetcd:2379" import -y /test ./test.json # ./etcdtool-3.4 --peers="https://myetcd:2379" export /test { "mylist": { "0": { "one": "uno" }, "1": { "two": "dos" } } }It would be great to export the directory so the resulting json file is the same that was loaded (expected behavior: when all the keys in a directory are whole numbers, then convert them into a list). Maybe it can be added as an optional parameter (e.g. --keep-lists)?.