Problem to Solve:
I am working on a KOTS application and there is a Config Field that I want the user to only set it upon initial install. Anytime after that, the field will be read-only.
I tried to use the readonly
field along with some templating but is not working. Here are some things I have tried:
readonly: repl{{ gt Sequence 1 }}
readonly: '{{repl gt Sequence 1 }}'
To make sure it wasn’t the ‘greater than’ function, I also tried with eq
:
readonly: repl{{ eq Sequence 1 }}
readonly: '{{repl eq Sequence 1 }}'
I have also tried adding |ParseBool
but also does not work. I also tried using double quotes but no luck. I get the following error from the linter:
RULE TYPE FILENAME LINE MESSAGE
config-is-invalid error manifests/kots-config.yaml failed to decode config content: json: cannot unmarshal string into Go struct field ConfigItem.spec.groups.items.readonly of type bool
Error: lint yaml: One or more errors of severity "error" or higher were found```