limitation in how helm_chart_versions can be overridden

Project that derive Sylva by building layers of value may need to override helm_chart_versions.

To do this in a maintainable way, it's often preferable to want to override everything in helm_chart_versions without inheriting anything from sylva upstream (or else, each time upstream sylva introduces new keys in a helm_chart_versions dict, downstream needs a change to nullify this key).

What works today and isn't ideal (example):

units:
  coredns:
    #...
    helm_chart_versions:
      1.43.302: null               #
      1.45.003: null               #  <== neutralize what comes from upstream
      1.45.9003+1.45.003: null     #  
      1.44.300: >-
        {{ include "k8s-version-match" (tuple ">=1.31.0,<1.32.0" .Values._internal.k8s_version) }}
      1.45.008: >-
        {{ include "k8s-version-match" (tuple ">=1.32.0" .Values._internal.k8s_version) }}

What would be nice todo:

units:
  coredns:
    helm_chart_versions: '{{ get .Values._internal.my_helm_chart_versions_overrides "coredns" | include "preserve-type" }}'

_internal:
  my_helm_chart_versions_overrides:
    coredns:
      helm_chart_versions:
        1.44.300: >-
          {{- tuple . "_internal.k8s_version" | include "interpret" -}}
          {{ include "k8s-version-match" (tuple ">=1.31.0,<1.32.0" .Values._internal.k8s_version) }}
        1.45.008: >-
          {{- tuple . "_internal.k8s_version" | include "interpret" -}}
          {{ include "k8s-version-match" (tuple ">=1.32.0" .Values._internal.k8s_version) }}

Unfortunately, this does not work because the sylva-units schema requires helm_chart_versions to be a dict, and refuse a string.

This will be easily fixed by a schema update.

Edited by Thomas Morin