juju is parsing config values of cli parameters as yaml. This is not documented behavior:
This is fine, it doesn't see it as a dictionary, just a string:
jason@inire:~/anbox_project$ juju model-defaults
cloudinit-userdata='ca_cert blah'
If I add a colon it sees it as a dictionary and breaks:
jason@inire:~/anbox_project$ juju model-defaults
cloudinit-userdata='ca_cert: blah'
ERROR json: unsupported type: map[interface {}]interface {}
If I add an extra set of single quotes it works fine again:
jason@inire:~/anbox_project$ juju model-defaults
cloudinit-userdata='"ca_cert: blah"'
It seems like juju is interpreting the value of model default config parameters as yaml in both cases - Why is it doing that? that's not documented in the help. Given that it seems to just want a string value, that's very weird.
This came up in bug 1832974.
juju model-config and juju model-defaults give different responses:
juju model-config cloudinit- userdata= 'ca-certs blah' interface {}
ERROR cloudinit-userdata: must be valid YAML: yaml: unmarshal errors:
line 1: cannot unmarshal !!str `ca-cert...` into map[string]