bjw-s / helm-charts

A collection of Helm charts
https://bjw-s.github.io/helm-charts/
Apache License 2.0
524 stars 98 forks source link

feat(common): allow creating configmaps from folder structure #321

Open LarryGF opened 2 months ago

LarryGF commented 2 months ago

Description of the change

This change allows to create ConfigMaps from files inside of a base folder in the repo

Added

Added a new "bjw-s.common.render.configMaps.fromFiles" template that gets all "first-level" folders under .Values.configMapsFromFolderBasePath and creates a ConfigMap with all the files within that folder

Benefits

Possible drawbacks

Additional information

I wanted to keep this DRY whithout losing on the advantages that the chart already gives while creating ConfigMaps from values. So I thought that, instead of differentiating between ConfigMaps declared in the values and ConfigMaps loaded from the repo, it would be better to just build the configMapValues from the files and inject them into .Values.configMaps before bjw-s.common.render.configMaps gets called. This way if the ConfigMap comes from the values or from the filesystem it will be transparent to the chart.

Checklist