DRY improvements #664

Merged
pat-s merged 36 commits from Ceddaerrix/gitea-helm-chart:DRY-improvements into main 2024-06-06 20:39:42 +00:00
Contributor

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
Ceddaerrix added 31 commits 2024-06-05 15:53:54 +00:00
Creating file for unit test of ingress configuration
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 28s
87dd3f8066
Editing asserts indentation
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 32s
b143e50567
Correcting lint errors in ingress-configuration.yaml
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 32s
1de07a6c48
Adding TPL function to 'gitea.inline_configuration.defaults.server' since (index .Values.ingress.hosts 0).host for server "DOMAIN" key
Improving DRY support - adding unit test for templates/gitea/config.yaml first document
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 1h8m28s
3645ddd276
Merge branch 'main' into main
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 16s
3297d86e94
Merge branch 'main' into main
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 23s
c50e719ad3
Reverting last change in '_helpers.tpl' "gitea.inline_configuration.defaults.server"
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 22s
0682c36c10
Reintroducing change in '_helpers.tpl' "gitea.inline_configuration.defaults.server" (line 322)
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 21s
a85a6dc3e6
Merge branch 'main' into main
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 23s
bc8dda59bc
Merge branch 'main' into main
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 21s
479e0c4f29
Merge branch 'main' of https://gitea.com/Ceddaerrix/gitea-helm-chart
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 0s
69d58ba606
Merge branch 'main' into main
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 0s
2812387665
Merge branch 'main' of https://gitea.com/Ceddaerrix/gitea-helm-chart
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 24s
a504545402
Correcting pattern of first matchRegex
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 53s
3fb40da20c
Correcting first assert
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 29s
560e6aa5f6
Adding EOL to unittests/deployment/inline-config.yaml
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 25s
ba74af0f01
Update unittests/deployment/inline-config.yaml
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 25s
6b8f45b711
Fixing lint issues in unittests/deployment/inline-config.yaml
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 26s
fd0888331e
Merge branch 'main' into main
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 31s
7e1687ad73
Correcting unit test isKind syntax
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 33s
30c8feacd8
Ceddaerrix requested review from justusbunsi 2024-06-05 15:53:54 +00:00
Ceddaerrix requested review from pat-s 2024-06-05 15:53:54 +00:00
Ceddaerrix added 1 commit 2024-06-05 16:04:46 +00:00
Rebase/merge
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 19s
f9011fb23e
Ceddaerrix added 1 commit 2024-06-05 16:35:11 +00:00
Correcting loginh into 'gitea.persistence.storageClass'
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 24s
e96e5345b2
Ceddaerrix added 1 commit 2024-06-05 16:37:26 +00:00
Correcting unit test isKind syntax
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 33s
9f21bc008f
Ceddaerrix added 1 commit 2024-06-05 17:11:57 +00:00
Update unittests/deployment/ingress-configuration.yaml
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 34s
bc3915ae4d
Ceddaerrix added 1 commit 2024-06-05 18:23:21 +00:00
Correcting ingress unit test name
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 35s
3aa520a0d7
pat-s approved these changes 2024-06-06 20:39:32 +00:00
pat-s left a comment
Collaborator

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.
pat-s merged commit b7b60dd51f into main 2024-06-06 20:39:42 +00:00
pat-s referenced this issue from a commit 2024-06-06 20:39:44 +00:00
Ceddaerrix deleted branch DRY-improvements 2024-11-20 14:59:38 +00:00
Sign in to join this conversation.
No description provided.