DRY improvements #664

Merged
Ceddaerrix merged 36 commits from refs/pull/664/head into main 2024-06-06 20:39:42 +00:00
Ceddaerrix commented 2024-06-05 15:53:53 +00:00 (Migrated from gitea.com)

Description of the change

Adding support for DRY principle (via use of the TPL function) to the PVC storage class and the ingress class

Benefits

It allows to reference a variable into another one to avoid duplicating them (or using YAML anchors).
It is useful and valuable when including Gitea into an umbrella chart with multiple components and to have a single variable while the components variable only refer to that single one.

Example 1

global:
  persistence:
    storageClass: "storage-class"
persistence:
  storageClass: "{{ .Values.global.persistence.storageClass }}"

This results in having spec.storageClassName equal to storage-class in the PVC object

Example 2

global:
  ingress:
    className: "ingress-class"
ingress:
  className: "{{ .Values.global.ingress.className}}"

This results in having spec.ingressClassName equal to ingress-class in the Ingress object

Possible drawbacks

N/A

Checklist

  • Templating unittests are added
### Description of the change Adding support for DRY principle (via use of the TPL function) to the PVC storage class and the ingress class ### Benefits It allows to reference a variable into another one to avoid duplicating them (or using YAML anchors). It is useful and valuable when including Gitea into an umbrella chart with multiple components and to have a single variable while the components variable only refer to that single one. Example 1 ``` global: persistence: storageClass: "storage-class" persistence: storageClass: "{{ .Values.global.persistence.storageClass }}" ``` This results in having `spec.storageClassName` equal to `storage-class` in the PVC object Example 2 ``` global: ingress: className: "ingress-class" ingress: className: "{{ .Values.global.ingress.className}}" ``` This results in having `spec.ingressClassName` equal to `ingress-class` in the Ingress object ### Possible drawbacks N/A ### Checklist - [X] Templating unittests are added
justusbunsi (Migrated from gitea.com) reviewed 2024-06-05 15:53:54 +00:00
pat-s (Migrated from gitea.com) approved these changes 2024-06-06 20:39:32 +00:00
pat-s (Migrated from gitea.com) left a comment

Thanks!

LGTM, thanks also for adding unit tests!

Given the working tests, I am confident enough we can include this directly into the next release.

Thanks! LGTM, thanks also for adding unit tests! Given the working tests, I am confident enough we can include this directly into the next release.
Sign in to join this conversation.
No description provided.