composing configs: baseconfig and a derived config, how to go about it #3975
-
|
Hi, I am a newbie to cue. I am trying to use it for configuration management where by say I have a config schema #Config{} with say a hundred fields and I have defined a "base" config baseConfig: #Config & {..} defining all the 100 fields with some values. Now I have many other configs which wants to take the base config and change say one or two fields out of the 100, each of the other configs might change different fields out of the 100. One way to do that is that in the other config files I can say otherConfig: #Config & {field1: baseConfig.field1, ... field99: baseConfig.field99, field100: } .. but this is a lot of repeated boilerplate lines. The other way would have been to say otherConfig: baseConfig & {field100: } but then I understand it wont work because field100 of baseConfig has its own constraints (say list length) which might not be not be satisified in .. so what are my options here ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
got this answered in discord `
|
Beta Was this translation helpful? Give feedback.
got this answered in discord
`
verdverm.com — Yesterday at 3:36 PM
In CUE, changing values is prohibited because it makes it difficult to know where a value was actually set from. A common approach is to have
3.A final, specific values CUE value where everything is set in stone
`