We have a few fields in our config (like the one following) which we do not want to show to our users anymore. These fields are all currently optional and have a a default value set on them, like so:
# ...
items:
- name: eg_broker_password
title: Example broker password
type: password
value: ""
default: random@1234
To hide them, I changed it to following:
# ...
items:
- name: eg_broker_password
title: Example broker password
type: password
value: {{repl RandomString 15}}
hidden: true
My thoughts were that changing the item to hidden: true
and specifying value as {{repl RandomString 15}}
would have the following effect:
- For existing customers who use the default value, Replicated will keep using the [old] default value.
- For existing customers who changed the default value, the modified value will be used.
- For any new customers, the
value
field will be evaluated using{{repl RandomString 15}}
and will be persisted.
However, for #1 (i.e. existing customers using the default value), an empty string was being injected now. I guess it was copying this from the old value
. I did not test for the other two cases. Instead, I added the old default value as well:
# ...
items:
- name: eg_broker_password
title: Example broker password
type: password
value: {{repl RandomString 15}}
hidden: true
default: random@1234
This works fine for #1 (existing customers using the default value still get the default value). But for #2 (existing customers who had modified this value), we again receive the default value (random@1234), rather than the actual value.
Rather than testing for #3, I thought it wise to just ask here since this must be a common use case for a lot of your other customers as well. How do you recommend that we hide these fields?