From 9a6cb4d35792d6b0fb8207f93dac4c620528d8a4 Mon Sep 17 00:00:00 2001 From: ooms97 Date: Thu, 9 Mar 2023 23:25:45 +0800 Subject: [PATCH] Make test pods optional and allow image override (#360) ### Description of the change Make the test-connection Pod optional and override the wget container's image. ### Benefits Allows users to enable/disabled the test-connection Pod and override the wget container's image. ### Checklist - [X] Parameters are documented in the `values.yaml` and added to the `README.md` using [readme-generator-for-helm](https://github.com/bitnami-labs/readme-generator-for-helm) - [X] Breaking changes are documented in the `README.md` Co-authored-by: Umer Anwar Co-authored-by: ooms97 Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/360 Reviewed-by: pat-s Reviewed-by: justusbunsi Co-authored-by: ooms97 Co-committed-by: ooms97 --- README.md | 9 ++++++--- templates/tests/test-http-connection.yaml | 4 +++- values.yaml | 8 ++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4c9914c..35eb8b1 100644 --- a/README.md +++ b/README.md @@ -815,9 +815,12 @@ gitea: ### Advanced -| Name | Description | Value | -| ------------------ | ---------------------------------------------------- | ------ | -| `checkDeprecation` | Set it to false to skip this basic validation check. | `true` | +| Name | Description | Value | +| ------------------ | ------------------------------------------------------------------ | --------- | +| `checkDeprecation` | Set it to false to skip this basic validation check. | `true` | +| `test.enabled` | Set it to false to disable test-connection Pod. | `true` | +| `test.image.name` | Image name for the wget container used in the test-connection Pod. | `busybox` | +| `test.image.tag` | Image tag for the wget container used in the test-connection Pod. | `latest` | ## Contributing diff --git a/templates/tests/test-http-connection.yaml b/templates/tests/test-http-connection.yaml index 7fab1b7..8157442 100644 --- a/templates/tests/test-http-connection.yaml +++ b/templates/tests/test-http-connection.yaml @@ -1,3 +1,4 @@ +{{- if .Values.test.enabled }} apiVersion: v1 kind: Pod metadata: @@ -9,7 +10,8 @@ metadata: spec: containers: - name: wget - image: busybox + image: "{{ .Values.test.image.name }}:{{ .Values.test.image.tag }}" command: ['wget'] args: ['{{ include "gitea.fullname" . }}-http:{{ .Values.service.http.port }}'] restartPolicy: Never +{{- end }} diff --git a/values.yaml b/values.yaml index 1213221..1d25a82 100644 --- a/values.yaml +++ b/values.yaml @@ -484,4 +484,12 @@ mariadb: # Set it to false to skip this basic validation check. ## @section Advanced ## @param checkDeprecation Set it to false to skip this basic validation check. +## @param test.enabled Set it to false to disable test-connection Pod. +## @param test.image.name Image name for the wget container used in the test-connection Pod. +## @param test.image.tag Image tag for the wget container used in the test-connection Pod. checkDeprecation: true +test: + enabled: true + image: + name: busybox + tag: latest