timoni icon indicating copy to clipboard operation
timoni copied to clipboard

Creating a ConfigMap entry from a YAML file

Open mattfield opened this issue 6 months ago • 1 comments

Hello!

I might be thinking about this in the wrong way so please do correct me!

I'm creating a Timoni module that, before conversion to CUE, was using Kustomize to generate a ConfigMap from a config YAML file (which is a few hundred lines long). This config YAML is different depending on environment and region, so I had the option to override the default YAML built in the Kustomize base.

What's the most straightforward to replicate this kind of pattern with Timoni? I had originally thought to pass a path to the config YAML as a value and then have Timoni import that YAML and assign it to the correct key in the ConfigMap but I can't quite figure out how to do that, or even whether it'd be the correct approach. I'm also planning on using Bundles and Runtimes so I wonder if pre-storing that config in the ConfigMap and reading it into Timoni via a Runtime at apply time would be another viable option, though that would still require getting the ConfigMap created in the first place which is the part I'd like to keep in the Module itself.

I'm sure there's a much more idiomatic Timoni/CUE way of handling something like this, so any and all advice greatly appreciated! Thanks!

mattfield avatar Dec 11 '23 12:12 mattfield