imageName and registry vars problem : not always same behavior
To customize Helm Chart values file in addons, we could use these vars, for example for Nextcloud deployment :
chart:
repoUrl: https://nextcloud.github.io/helm
version: 6.2.1
registry: docker.io
imageName: nextcloud
imageTag: 28.0.11
In some addons default templates vars, we've got imageName defined like this :
imageName: hub.eole.education/eole3/screego-container-image/screego
or
imageName: hub.eole.education/eole3/nextcloud-container-image/nextcloud
It should be defined like this :
registry: hub.eole.education/eole3/nextcloud-container-image
imageName: nextcloud
Is it possible to update this implementaion and adapt it on all Eole³ Tools addons please ?
To be functional, we need parse registry value. Example in addons/collabora/templates/collabora-values.yaml :
{%- set registry = get_value(config, "collabora", 'chart:registry') -%}
{%- set imageName = get_value(config, "collabora", 'chart:imageName') -%}
{%- set imageTag = get_value(config, "collabora", 'chart:imageTag') -%}
image:
repository: {{ registry }}/{{ imageName }}
tag: {{ imageTag }}
Not present in addons/nextcloud/templates/nextcloud-values.yaml :
nameOverride: "{{ config['nextcloud']['hostname'] }}"
fullnameOverride: "{{ config['nextcloud']['hostname'] }}"
image:
repository: {{ config['nextcloud']['chart']['imageName'] }}
Incomplete or partially good in Screego ? (no image
section)
{%- if get_value(config, "screego", "chart:registry") != "upstream" %}
{{ main_image(config, "screego", "screego", image_key="repository") }}
{%- endif %}
The best behavior should be :
image:
repository: {{ config['nextcloud']['chart']['registry'] }}/{{ config['nextcloud']['chart']['imageName'] }}
tag: {{ config['nextcloud']['chart']['imageTag'] }}
Edited by Stéphane PAILLET