The purpose of this template is to provide a means to prevent users from deploying the Helm chart, or updates to it, in what would be a broken state due to changes in how the chart is configured.
The design makes use of multiple templates, providing a modular method of declaring and managing deprecations. This is to aid in simplification of both development and maintenance.
- The last item in
includes further templates in the same file, collecting their outputs (strings) into a
- Each individual template handles detection of now errant configuration, and outputs messages informing the user of how to address the change, or outputs nothing.
gitlab.deprecationstemplate checks if any messages were collected. If any messages were, it outputs them under a header of
failfunction results in the termination of the deployment process, preventing the user from deploying with a broken configuration.
Templates defined within, and used with this pattern should follow the naming convention of
* here with an informative name, such as
registry.storage to denote what this deprecation is related to.
The developer should be careful not to assume that a key, or parent key will exist. Judicious application of
empty are strongly recommended. It is just as likely for a single key to be present as it is for the entire property map to be missing several branches before that key. Helm will complain if you attempt to access a property that does not exist within the map structure, generally in a vague manor. Save time, be explicit.
All messages should have the following format:
ifstatement preceding the message should not trim the newline after it. (
-}}) This ensures the formatting and readability for the user.
- The message should declare which chart, relative to the global chart, that is affected. This helps the user understand where the property came from in the charts, and configuration properties. Example:
- The message should inform the user of the property that has been altered / relocated / deprecated, and what action should be taken. Name the property relative to the affected chart. For example,
gitlab.unicorn.minio.enabledwould be referenced as
minio.enabledbecause the chart affected by the deprecation is
gitlab.unicorn: Chart-local configuration of Minio features has been moved to global. Please remove `gitlab.unicorn.minio.enabled` from your properties, and set `global.minio.enabled` instead.
Once a template has been defined, and logic placed within it for the detection of affected properties, activating this new template is simple. Simple add a line beneath
add templates here in the
gitlab.deprecations template, according to the format presented.