google / google/jsonnet

Return the keys of dictionaries in order

Open
#407 4 comments 7 reactions 0 assignees View on GitHub
Dominant language
Jsonnet
Stars
7.6k
Forks
475
PR merge metrics
No merged PRs in 30d

Description

Using jsonnet with k8s I've noticed an interesting pattern—whenever you specify a list of key-value strings in k8s, jsonnet's objects work better. One way to use that is to map command line aruments, e.g.

```
args_+: {
tls_cert: '/abc',
tls_key: '/def',
}
```

becomes

```--tls-cert=/abc --tls-key=/def```

One problem with that approach is that jsonnet sorts all the keys, thus making it very hard to deal with situations when key order is important.

I'd like to see a mechanism to turn objects into what's basically an OrderedDict of python.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.