-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ordering of charm config items #568
Comments
So it turns out that the GUI isn't sorting these values after all, but instead presenting them in the same order it's returned from the charmstore so I'm not sure why one api call is returning them sorted and another returning them as-is in the config.yaml. |
I think this happens because internally, in both juju and the charm store, charm options are represented as a map (see [1]) which is an unordered collection. I think the charm store should be patched to be consistent with juju by reordering the fields alphabetically on the meta endpoint. |
After further investigation, it seems that the charm store already sorts the options alphabetically (see [1]). So second guess is that it depends on how js and python decode a JSON map by default: js into an object in which fields ordering is accidentally kept, python into a dict which is unordered. [1] https://api.jujucharms.com/charmstore/v5/~juju-gui/jujushell/meta/charm-config |
In my config.yaml, I carefully order items so that related config is next to each other and newer config keys which replace others are 'above' the deprecated ones.
However, when I look at the charm details page, the config items are seemingly randomly ordered.
I note that the Juju CLI and Juju GUI order the values asciibetically, which whilst not perfect, is at least understandable.
The text was updated successfully, but these errors were encountered: