feat(chart): add dry support to "gitea.actions.local_root_url" function (#74)
Some checks failed
changelog / changelog (push) Failing after 22s
check-and-test / check-and-test (push) Failing after 12s

<!--
 Before you open the request please review the following guidelines and tips to help it be more easily integrated:

 - Describe the scope of your change - i.e. what the change does.
 - Describe any known limitations with your change.
 - Please run any tests or examples that can exercise your modified code.

 Thank you for contributing! We will try to review, test and integrate the change as soon as we can.
 -->

### Description of the change

Introducing use of the `tpl` function into _"gitea.actions.local_root_url"_ (in `_helpers.tpl`) so templating into the `giteaRootURL` parameter can be interpreted.
Hence, it will permit the use of values already set in other parameters.

### Benefits

To allow in an umbrella chart referencing to other values for setting the Gitea Root URL

### Possible drawbacks

<!-- Describe any known limitations with your change -->

### Applicable issues

<!-- Enter any applicable Issues here (You can reference an issue using #). Please remove this section if there is no referenced issue. -->
- Fixes #

### Additional information

<!-- If there's anything else that's important and relevant to your pull request, mention that information here. Please remove this section if it remains empty. -->

### ⚠ BREAKING

 - N/A

### Checklist

<!-- [Place an '[X]' (no spaces) in all applicable fields. Please remove unrelated fields.] -->

- [x] Helm templating unittests are added (required when changing anything in `templates` folder)

Co-authored-by: 212597596 <cedric.henry@gevernova.com>
Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/74
Reviewed-by: DaanSelen <daanselen@noreply.gitea.com>
Co-authored-by: Ceddaerrix <ceddaerrix@noreply.gitea.com>
Co-committed-by: Ceddaerrix <ceddaerrix@noreply.gitea.com>
This commit is contained in:
Ceddaerrix
2026-01-02 17:57:52 +00:00
committed by DaanSelen
parent 343b279b0f
commit 0edfe5fba6
2 changed files with 33 additions and 1 deletions

View File

@ -429,3 +429,35 @@ tests:
content:
mountPath: /mnt
name: my-dind-volume
- it: should interpret Gitea Root URL templating
template: templates/statefulset.yaml
set:
global:
gitea:
service:
name: "my-gitea-svc-http"
port: 3210
enabled: true
giteaRootURL: "http://{{ .Values.global.gitea.service.name }}:{{ .Values.global.gitea.service.port }}"
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: StatefulSet
apiVersion: apps/v1
name: gitea-unittests-actions-act-runner
- equal:
path: spec.template.spec.containers[0].env[1].name
value: "GITEA_INSTANCE_URL"
- equal:
path: spec.template.spec.containers[0].env[1].value
value: "http://my-gitea-svc-http:3210"
- equal:
path: spec.template.spec.initContainers[0].command[2]
value: |
echo 'Trying to reach Gitea on http://my-gitea-svc-http:3210'
until timeout 10 wget --no-check-certificate --spider http://my-gitea-svc-http:3210; do
sleep 3
echo "Trying again in 3 seconds..."
done
echo "Gitea has been reached!"