vidispine / hull

The incredible HULL - Helm Uniform Layer Library - is a Helm library chart to improve Helm chart based workflows
https://github.com/vidispine/hull
Apache License 2.0
231 stars 13 forks source link

Combine boolean evaluation `_HT?` with get `_HT*` and include `_HT/` transformations #322

Closed gre9ory closed 5 months ago

gre9ory commented 5 months ago

State When using _HT? the conditional expression must be written in native Go Templating syntax making it unconvenient to access fields or use includes in a short form

Feature Idea Combine _HT? with _HT* and _HT/ so that a shorter form is sufficient to write the condition.

Alternative 1: Combine symbols like _HT?* and _HT?/ Alternative 2: Combine expressions like _HT?_HT* and _HT?_HT/

In both variants, it must be detected that the condition is a HULL transformation and not a Go templating expression. The HULL transformation must be executed and the result subjected to the boolean check.

gre9ory commented 5 months ago

It is now possible to combine _HT? with includes by using _HT?/ prefix. If the include returns literal true or false the result is treated as a boolean value making it suitable for checks.

For _HT?* the requirement is sufficiently satisfied with the ability to use _HT* references within _HT! and _HT? template code now. If the content of the _HT? check is only the evaluation of a reference to a boolean field this already works by directly addressing the field using _HT* since _HT* returns the correct type.