refactor(templates): rename template files to match rendered resource kinds
The files in templates/gitea/ used a mix of naming styles: lowercase concatenations (poddisruptionbudget.yaml, serviceaccount.yaml, servicemonitor.yaml, pvc.yaml), camelCase (httpService.yaml, sshService.yaml) and kind-suffixed names (gpg-secret.yaml, metrics-secret.yaml). It was therefore not obvious from a file name which Kubernetes resource it renders, and the naming contradicted the camelCase convention the Gateway API templates already follow. Files are now named after the kind they render, with a lowercase suffix distinguishing several resources of the same kind: config.yaml -> secret_config.yaml + secret_inlineConfig.yaml gpg-secret.yaml -> secret_gpg.yaml init.yaml -> secret_init.yaml metrics-secret.yaml -> secret_metrics.yaml httpService.yaml -> service_http.yaml sshService.yaml -> service_ssh.yaml poddisruptionbudget.yaml -> podDisruptionBudget.yaml pvc.yaml -> persistentVolumeClaim.yaml serviceaccount.yaml -> serviceAccount.yaml servicemonitor.yaml -> serviceMonitor.yaml config.yaml rendered two Secrets from a single file, which forced every unit test to address them via documentIndex. It is split so that each file renders exactly one resource. The rendered manifests are unchanged; only file names and the references to them were touched. This includes the checksum/config annotation in deployment.yaml and all helm unit test suites. The HA guard assertions had to move from deployment.yaml to secret_config.yaml: Helm sorts templates in reverse alphabetical order, so secret_config.yaml is now rendered before deployment.yaml and the fail() is reported for that file directly instead of bubbling up through the include chain of the Deployment. Users relying on the template paths (e.g. `helm template --show-only` or post-renderers) have to adjust to the new file names. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -27,7 +27,7 @@ spec:
|
|||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
checksum/config: {{ include (print $.Template.BasePath "/gitea/config.yaml") . | sha256sum }}
|
checksum/config: {{ include (print $.Template.BasePath "/gitea/secret_config.yaml") . | sha256sum }}
|
||||||
{{- range $idx, $value := .Values.gitea.ldap }}
|
{{- range $idx, $value := .Values.gitea.ldap }}
|
||||||
checksum/ldap_{{ $idx }}: {{ include "gitea.ldap_settings" (list $idx $value) | sha256sum }}
|
checksum/ldap_{{ $idx }}: {{ include "gitea.ldap_settings" (list $idx $value) | sha256sum }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -1,13 +1,3 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name: {{ include "gitea.fullname" . }}-inline-config
|
|
||||||
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
|
||||||
labels:
|
|
||||||
{{- include "gitea.labels" . | nindent 4 }}
|
|
||||||
type: Opaque
|
|
||||||
stringData:
|
|
||||||
{{- include "gitea.inline_configuration" . | nindent 2 }}
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
@@ -25,7 +15,7 @@ stringData:
|
|||||||
{{- if and (.Values.postgresql.enabled) (index .Values "postgresql-ha" "enabled") -}}
|
{{- if and (.Values.postgresql.enabled) (index .Values "postgresql-ha" "enabled") -}}
|
||||||
{{- fail "Only one of postgresql or postgresql-ha can be enabled at the same time." -}}
|
{{- fail "Only one of postgresql or postgresql-ha can be enabled at the same time." -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- /* multiple replicas assertions */ -}}
|
{{- /* multiple replicas assertions */ -}}
|
||||||
{{- if gt (.Values.replicaCount | int) 1 -}}
|
{{- if gt (.Values.replicaCount | int) 1 -}}
|
||||||
{{- if .Values.gitea.config.cron -}}
|
{{- if .Values.gitea.config.cron -}}
|
||||||
@@ -35,7 +25,7 @@ stringData:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- if eq (first .Values.persistence.accessModes) "ReadWriteOnce" -}}
|
{{- if eq (first .Values.persistence.accessModes) "ReadWriteOnce" -}}
|
||||||
{{- fail "When using multiple replicas, a RWX file system is required and persistence.accessModes[0] must be set to ReadWriteMany." -}}
|
{{- fail "When using multiple replicas, a RWX file system is required and persistence.accessModes[0] must be set to ReadWriteMany." -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -53,5 +43,5 @@ stringData:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "gitea.fullname" . }}-inline-config
|
||||||
|
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
{{- include "gitea.labels" . | nindent 4 }}
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
{{- include "gitea.inline_configuration" . | nindent 2 }}
|
||||||
@@ -3,17 +3,17 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_inlineConfig.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: "actions are enabled by default (based on vanilla Gitea behavior)"
|
- it: "actions are enabled by default (based on vanilla Gitea behavior)"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- documentIndex: 0
|
- documentIndex: 0
|
||||||
notExists:
|
notExists:
|
||||||
path: stringData.actions
|
path: stringData.actions
|
||||||
|
|
||||||
- it: "actions can be disabled via inline config"
|
- it: "actions can be disabled via inline config"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
gitea.config.actions.ENABLED: false
|
gitea.config.actions.ENABLED: false
|
||||||
asserts:
|
asserts:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
tests:
|
tests:
|
||||||
- it: "cache is configured correctly for valkey"
|
- it: "cache is configured correctly for valkey"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
valkey:
|
valkey:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -17,7 +17,7 @@ tests:
|
|||||||
HOST=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
HOST=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||||
|
|
||||||
- it: "cache is configured correctly for 'memory' when valkey is disabled"
|
- it: "cache is configured correctly for 'memory' when valkey is disabled"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
valkey:
|
valkey:
|
||||||
enabled: false
|
enabled: false
|
||||||
@@ -30,7 +30,7 @@ tests:
|
|||||||
HOST=
|
HOST=
|
||||||
|
|
||||||
- it: "cache can be customized when valkey is disabled"
|
- it: "cache can be customized when valkey is disabled"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
valkey:
|
valkey:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: uses `gitea config edit-ini` to write app.ini from environment variables
|
- it: uses `gitea config edit-ini` to write app.ini from environment variables
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_config.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- documentIndex: 1
|
- documentIndex: 0
|
||||||
matchRegex:
|
matchRegex:
|
||||||
path: stringData["config_environment.sh"]
|
path: stringData["config_environment.sh"]
|
||||||
pattern: 'gitea config edit-ini --apply-env --config .+GITEA_APP_INI.+ --out .+GITEA_APP_INI'
|
pattern: 'gitea config edit-ini --apply-env --config .+GITEA_APP_INI.+ --out .+GITEA_APP_INI'
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
tests:
|
tests:
|
||||||
- it: metrics token is set
|
- it: metrics token is set
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
gitea:
|
gitea:
|
||||||
metrics:
|
metrics:
|
||||||
@@ -18,7 +18,7 @@ tests:
|
|||||||
ENABLED=true
|
ENABLED=true
|
||||||
TOKEN=somepassword
|
TOKEN=somepassword
|
||||||
- it: metrics token is empty
|
- it: metrics token is empty
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
gitea:
|
gitea:
|
||||||
metrics:
|
metrics:
|
||||||
@@ -31,7 +31,7 @@ tests:
|
|||||||
value: |-
|
value: |-
|
||||||
ENABLED=true
|
ENABLED=true
|
||||||
- it: metrics token is nil
|
- it: metrics token is nil
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
gitea:
|
gitea:
|
||||||
metrics:
|
metrics:
|
||||||
@@ -44,7 +44,7 @@ tests:
|
|||||||
value: |-
|
value: |-
|
||||||
ENABLED=true
|
ENABLED=true
|
||||||
- it: does not configures a token if metrics are disabled
|
- it: does not configures a token if metrics are disabled
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
gitea:
|
gitea:
|
||||||
metrics:
|
metrics:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
tests:
|
tests:
|
||||||
- it: "queue is configured correctly for valkey"
|
- it: "queue is configured correctly for valkey"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
valkey:
|
valkey:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -17,7 +17,7 @@ tests:
|
|||||||
TYPE=redis
|
TYPE=redis
|
||||||
|
|
||||||
- it: "queue is configured correctly for 'levelDB' when valkey is disabled"
|
- it: "queue is configured correctly for 'levelDB' when valkey is disabled"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
valkey:
|
valkey:
|
||||||
enabled: false
|
enabled: false
|
||||||
@@ -30,7 +30,7 @@ tests:
|
|||||||
TYPE=level
|
TYPE=level
|
||||||
|
|
||||||
- it: "queue can be customized when valkey is disabled"
|
- it: "queue can be customized when valkey is disabled"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
valkey:
|
valkey:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
tests:
|
tests:
|
||||||
- it: "[default values] uses ingress host for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
- it: "[default values] uses ingress host for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- documentIndex: 0
|
- documentIndex: 0
|
||||||
matchRegex:
|
matchRegex:
|
||||||
@@ -22,7 +22,7 @@ tests:
|
|||||||
################################################
|
################################################
|
||||||
|
|
||||||
- it: "[no ingress hosts] uses gitea http service for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
- it: "[no ingress hosts] uses gitea http service for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
ingress:
|
ingress:
|
||||||
hosts: []
|
hosts: []
|
||||||
@@ -43,7 +43,7 @@ tests:
|
|||||||
################################################
|
################################################
|
||||||
|
|
||||||
- it: "[provided via values] uses that for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
- it: "[provided via values] uses that for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
gitea.config.server.DOMAIN: provided.example.com
|
gitea.config.server.DOMAIN: provided.example.com
|
||||||
ingress:
|
ingress:
|
||||||
@@ -69,7 +69,7 @@ tests:
|
|||||||
################################################
|
################################################
|
||||||
|
|
||||||
- it: "[route enabled] uses route host for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
- it: "[route enabled] uses route host for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
route:
|
route:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -91,7 +91,7 @@ tests:
|
|||||||
################################################
|
################################################
|
||||||
|
|
||||||
- it: "[route tls termination] uses https for ROOT_URL"
|
- it: "[route tls termination] uses https for ROOT_URL"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
route:
|
route:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -107,7 +107,7 @@ tests:
|
|||||||
################################################
|
################################################
|
||||||
|
|
||||||
- it: "[HTTPRoute enabled] uses first hostname for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
- it: "[HTTPRoute enabled] uses first hostname for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
ingress:
|
ingress:
|
||||||
hosts: []
|
hosts: []
|
||||||
@@ -137,7 +137,7 @@ tests:
|
|||||||
################################################
|
################################################
|
||||||
|
|
||||||
- it: "[HTTPRoute tls] switches ROOT_URL to https"
|
- it: "[HTTPRoute tls] switches ROOT_URL to https"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
ingress:
|
ingress:
|
||||||
hosts: []
|
hosts: []
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
tests:
|
tests:
|
||||||
- it: "session is configured correctly for valkey"
|
- it: "session is configured correctly for valkey"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
valkey:
|
valkey:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -17,7 +17,7 @@ tests:
|
|||||||
PROVIDER_CONFIG=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
PROVIDER_CONFIG=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||||
|
|
||||||
- it: "session is configured correctly for 'memory' when valkey is disabled"
|
- it: "session is configured correctly for 'memory' when valkey is disabled"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
valkey:
|
valkey:
|
||||||
enabled: false
|
enabled: false
|
||||||
@@ -30,7 +30,7 @@ tests:
|
|||||||
PROVIDER_CONFIG=
|
PROVIDER_CONFIG=
|
||||||
|
|
||||||
- it: "session can be customized when valkey is disabled"
|
- it: "session can be customized when valkey is disabled"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
set:
|
set:
|
||||||
valkey:
|
valkey:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ tests:
|
|||||||
name: gitea-unittests-postgresql-ha-pgpool
|
name: gitea-unittests-postgresql-ha-pgpool
|
||||||
namespace: testing
|
namespace: testing
|
||||||
- it: "[gitea] connects to pgpool service"
|
- it: "[gitea] connects to pgpool service"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- documentIndex: 0
|
- documentIndex: 0
|
||||||
matchRegex:
|
matchRegex:
|
||||||
@@ -115,14 +115,14 @@ tests:
|
|||||||
- it: "[gitea] connects to pgpool service with custom cluster domain"
|
- it: "[gitea] connects to pgpool service with custom cluster domain"
|
||||||
set:
|
set:
|
||||||
clusterDomain: my-special-cluster.local
|
clusterDomain: my-special-cluster.local
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- documentIndex: 0
|
- documentIndex: 0
|
||||||
matchRegex:
|
matchRegex:
|
||||||
path: stringData.database
|
path: stringData.database
|
||||||
pattern: HOST=gitea-unittests-postgresql-ha-pgpool.testing.svc.my-special-cluster.local:1234
|
pattern: HOST=gitea-unittests-postgresql-ha-pgpool.testing.svc.my-special-cluster.local:1234
|
||||||
- it: "[gitea] connects to configured database"
|
- it: "[gitea] connects to configured database"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- documentIndex: 0
|
- documentIndex: 0
|
||||||
matchRegex:
|
matchRegex:
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ tests:
|
|||||||
name: gitea-unittests-postgresql
|
name: gitea-unittests-postgresql
|
||||||
namespace: testing
|
namespace: testing
|
||||||
- it: "[gitea] connects to postgresql service"
|
- it: "[gitea] connects to postgresql service"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- documentIndex: 0
|
- documentIndex: 0
|
||||||
matchRegex:
|
matchRegex:
|
||||||
@@ -74,14 +74,14 @@ tests:
|
|||||||
- it: "[gitea] connects to postgresql service with custom cluster domain"
|
- it: "[gitea] connects to postgresql service with custom cluster domain"
|
||||||
set:
|
set:
|
||||||
clusterDomain: my-special-cluster.local
|
clusterDomain: my-special-cluster.local
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- documentIndex: 0
|
- documentIndex: 0
|
||||||
matchRegex:
|
matchRegex:
|
||||||
path: stringData.database
|
path: stringData.database
|
||||||
pattern: HOST=gitea-unittests-postgresql.testing.svc.my-special-cluster.local:1234
|
pattern: HOST=gitea-unittests-postgresql.testing.svc.my-special-cluster.local:1234
|
||||||
- it: "[gitea] connects to configured database"
|
- it: "[gitea] connects to configured database"
|
||||||
template: templates/gitea/config.yaml
|
template: templates/gitea/secret_inlineConfig.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- documentIndex: 0
|
- documentIndex: 0
|
||||||
matchRegex:
|
matchRegex:
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ tests:
|
|||||||
targetPort: tcp
|
targetPort: tcp
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
- it: "[gitea] waits for valkey to be up and running"
|
- it: "[gitea] waits for valkey to be up and running"
|
||||||
template: templates/gitea/init.yaml
|
template: templates/gitea/secret_init.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- documentIndex: 0
|
- documentIndex: 0
|
||||||
matchRegex:
|
matchRegex:
|
||||||
@@ -44,7 +44,7 @@ tests:
|
|||||||
- it: "[gitea] waits for valkey to be up and running with custom cluster domain"
|
- it: "[gitea] waits for valkey to be up and running with custom cluster domain"
|
||||||
set:
|
set:
|
||||||
clusterDomain: my-special-cluster.local
|
clusterDomain: my-special-cluster.local
|
||||||
template: templates/gitea/init.yaml
|
template: templates/gitea/secret_init.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- documentIndex: 0
|
- documentIndex: 0
|
||||||
matchRegex:
|
matchRegex:
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/deployment.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: fails with multiple replicas and "GIT_GC_REPOS" enabled
|
- it: fails with multiple replicas and "GIT_GC_REPOS" enabled
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/secret_config.yaml
|
||||||
set:
|
set:
|
||||||
replicaCount: 2
|
replicaCount: 2
|
||||||
persistence:
|
persistence:
|
||||||
@@ -22,14 +22,14 @@ tests:
|
|||||||
- failedTemplate:
|
- failedTemplate:
|
||||||
errorMessage: "Invoking the garbage collector via CRON is not yet supported when running with multiple replicas. Please set 'gitea.config.cron.GIT_GC_REPOS.enabled = false'."
|
errorMessage: "Invoking the garbage collector via CRON is not yet supported when running with multiple replicas. Please set 'gitea.config.cron.GIT_GC_REPOS.enabled = false'."
|
||||||
- it: fails with multiple replicas and RWX file system not set
|
- it: fails with multiple replicas and RWX file system not set
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/secret_config.yaml
|
||||||
set:
|
set:
|
||||||
replicaCount: 2
|
replicaCount: 2
|
||||||
asserts:
|
asserts:
|
||||||
- failedTemplate:
|
- failedTemplate:
|
||||||
errorMessage: "When using multiple replicas, a RWX file system is required and persistence.accessModes[0] must be set to ReadWriteMany."
|
errorMessage: "When using multiple replicas, a RWX file system is required and persistence.accessModes[0] must be set to ReadWriteMany."
|
||||||
- it: fails with multiple replicas and bleve issue indexer
|
- it: fails with multiple replicas and bleve issue indexer
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/secret_config.yaml
|
||||||
set:
|
set:
|
||||||
replicaCount: 2
|
replicaCount: 2
|
||||||
persistence:
|
persistence:
|
||||||
@@ -43,7 +43,7 @@ tests:
|
|||||||
- failedTemplate:
|
- failedTemplate:
|
||||||
errorMessage: "When using multiple replicas, the issue indexer (gitea.config.indexer.ISSUE_INDEXER_TYPE) must be set to a HA-ready provider such as 'meilisearch', 'elasticsearch' or 'db' (if the DB is HA-ready)."
|
errorMessage: "When using multiple replicas, the issue indexer (gitea.config.indexer.ISSUE_INDEXER_TYPE) must be set to a HA-ready provider such as 'meilisearch', 'elasticsearch' or 'db' (if the DB is HA-ready)."
|
||||||
- it: fails with multiple replicas and bleve repo indexer
|
- it: fails with multiple replicas and bleve repo indexer
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/secret_config.yaml
|
||||||
set:
|
set:
|
||||||
replicaCount: 2
|
replicaCount: 2
|
||||||
persistence:
|
persistence:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/deployment.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: renders a deployment
|
- it: renders a deployment
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/deployment.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: Renders a deployment
|
- it: Renders a deployment
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/deployment.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: uses direct execution when extraEnvSourceFile is not set
|
- it: uses direct execution when extraEnvSourceFile is not set
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/deployment.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: Render the deployment (default)
|
- it: Render the deployment (default)
|
||||||
asserts:
|
asserts:
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ chart:
|
|||||||
appVersion: 1.19.3
|
appVersion: 1.19.3
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/deployment.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: default values
|
- it: default values
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_inlineConfig.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: inline config stringData.server using TPL
|
- it: inline config stringData.server using TPL
|
||||||
set:
|
set:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/deployment.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: renders openshift-compatible defaults for chart-managed containers
|
- it: renders openshift-compatible defaults for chart-managed containers
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/deployment.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: renders default liveness probe
|
- it: renders default liveness probe
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/deployment.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: supports adding a sidecar container
|
- it: supports adding a sidecar container
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/deployment.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: skips gpg init container
|
- it: skips gpg init container
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/deployment.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: adds gpg init container
|
- it: adds gpg init container
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/deployment.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: supports defining SSH log level for root based image
|
- it: supports defining SSH log level for root based image
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ release:
|
|||||||
namespace: testing
|
namespace: testing
|
||||||
|
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/pvc.yaml
|
- templates/gitea/persistentVolumeClaim.yaml
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
- it: should set storageClassName when persistence.storageClass is defined
|
- it: should set storageClassName when persistence.storageClass is defined
|
||||||
template: templates/gitea/pvc.yaml
|
template: templates/gitea/persistentVolumeClaim.yaml
|
||||||
set:
|
set:
|
||||||
persistence.storageClass: "my-storage-class"
|
persistence.storageClass: "my-storage-class"
|
||||||
asserts:
|
asserts:
|
||||||
@@ -20,7 +20,7 @@ tests:
|
|||||||
value: "my-storage-class"
|
value: "my-storage-class"
|
||||||
|
|
||||||
- it: should set global.storageClass when persistence.storageClass is not defined
|
- it: should set global.storageClass when persistence.storageClass is not defined
|
||||||
template: templates/gitea/pvc.yaml
|
template: templates/gitea/persistentVolumeClaim.yaml
|
||||||
set:
|
set:
|
||||||
global.storageClass: "default-storage-class"
|
global.storageClass: "default-storage-class"
|
||||||
asserts:
|
asserts:
|
||||||
@@ -29,7 +29,7 @@ tests:
|
|||||||
value: "default-storage-class"
|
value: "default-storage-class"
|
||||||
|
|
||||||
- it: should set storageClassName when persistence.storageClass is defined and global.storageClass is defined
|
- it: should set storageClassName when persistence.storageClass is defined and global.storageClass is defined
|
||||||
template: templates/gitea/pvc.yaml
|
template: templates/gitea/persistentVolumeClaim.yaml
|
||||||
set:
|
set:
|
||||||
global.storageClass: "default-storage-class"
|
global.storageClass: "default-storage-class"
|
||||||
persistence.storageClass: "my-storage-class"
|
persistence.storageClass: "my-storage-class"
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/sshService.yaml
|
- templates/gitea/service_ssh.yaml
|
||||||
- templates/gitea/httpService.yaml
|
- templates/gitea/service_http.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: supports adding custom labels to sshService
|
- it: supports adding custom labels to sshService
|
||||||
template: templates/gitea/sshService.yaml
|
template: templates/gitea/service_ssh.yaml
|
||||||
set:
|
set:
|
||||||
service:
|
service:
|
||||||
ssh:
|
ssh:
|
||||||
@@ -19,7 +19,7 @@ tests:
|
|||||||
value: "testvalue"
|
value: "testvalue"
|
||||||
|
|
||||||
- it: keeps existing labels (ssh)
|
- it: keeps existing labels (ssh)
|
||||||
template: templates/gitea/sshService.yaml
|
template: templates/gitea/service_ssh.yaml
|
||||||
set:
|
set:
|
||||||
service:
|
service:
|
||||||
ssh:
|
ssh:
|
||||||
@@ -29,7 +29,7 @@ tests:
|
|||||||
path: metadata.labels["app"]
|
path: metadata.labels["app"]
|
||||||
|
|
||||||
- it: supports adding custom labels to httpService
|
- it: supports adding custom labels to httpService
|
||||||
template: templates/gitea/httpService.yaml
|
template: templates/gitea/service_http.yaml
|
||||||
set:
|
set:
|
||||||
service:
|
service:
|
||||||
http:
|
http:
|
||||||
@@ -41,7 +41,7 @@ tests:
|
|||||||
value: "testvalue"
|
value: "testvalue"
|
||||||
|
|
||||||
- it: keeps existing labels (http)
|
- it: keeps existing labels (http)
|
||||||
template: templates/gitea/httpService.yaml
|
template: templates/gitea/service_http.yaml
|
||||||
set:
|
set:
|
||||||
service:
|
service:
|
||||||
http:
|
http:
|
||||||
@@ -51,7 +51,7 @@ tests:
|
|||||||
path: metadata.labels["app"]
|
path: metadata.labels["app"]
|
||||||
|
|
||||||
- it: render service.ssh.loadBalancerClass if set and type is LoadBalancer
|
- it: render service.ssh.loadBalancerClass if set and type is LoadBalancer
|
||||||
template: templates/gitea/sshService.yaml
|
template: templates/gitea/service_ssh.yaml
|
||||||
set:
|
set:
|
||||||
service:
|
service:
|
||||||
ssh:
|
ssh:
|
||||||
@@ -73,7 +73,7 @@ tests:
|
|||||||
value: ["1.2.3.4/32", "5.6.7.8/32"]
|
value: ["1.2.3.4/32", "5.6.7.8/32"]
|
||||||
|
|
||||||
- it: does not render when loadbalancer properties are set but type is not loadBalancerClass
|
- it: does not render when loadbalancer properties are set but type is not loadBalancerClass
|
||||||
template: templates/gitea/httpService.yaml
|
template: templates/gitea/service_http.yaml
|
||||||
set:
|
set:
|
||||||
service:
|
service:
|
||||||
http:
|
http:
|
||||||
@@ -92,7 +92,7 @@ tests:
|
|||||||
path: spec.loadBalancerSourceRanges
|
path: spec.loadBalancerSourceRanges
|
||||||
|
|
||||||
- it: does not render loadBalancerClass by default even when type is LoadBalancer
|
- it: does not render loadBalancerClass by default even when type is LoadBalancer
|
||||||
template: templates/gitea/httpService.yaml
|
template: templates/gitea/service_http.yaml
|
||||||
set:
|
set:
|
||||||
service:
|
service:
|
||||||
http:
|
http:
|
||||||
@@ -107,8 +107,8 @@ tests:
|
|||||||
|
|
||||||
- it: both ssh and http services exist
|
- it: both ssh and http services exist
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/sshService.yaml
|
- templates/gitea/service_ssh.yaml
|
||||||
- templates/gitea/httpService.yaml
|
- templates/gitea/service_http.yaml
|
||||||
asserts:
|
asserts:
|
||||||
- matchRegex:
|
- matchRegex:
|
||||||
path: metadata.name
|
path: metadata.name
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/gpg-secret.yaml
|
- templates/gitea/secret_gpg.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: renders nothing
|
- it: renders nothing
|
||||||
set:
|
set:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/gpg-secret.yaml
|
- templates/gitea/secret_gpg.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: fails rendering when nothing is configured
|
- it: fails rendering when nothing is configured
|
||||||
set:
|
set:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/init.yaml
|
- templates/gitea/secret_init.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: renders a secret
|
- it: renders a secret
|
||||||
asserts:
|
asserts:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/init.yaml
|
- templates/gitea/secret_init.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: runs gpg in batch mode
|
- it: runs gpg in batch mode
|
||||||
set:
|
set:
|
||||||
@@ -63,7 +63,7 @@ tests:
|
|||||||
chown -v 1000:1000 "${GNUPGHOME}"
|
chown -v 1000:1000 "${GNUPGHOME}"
|
||||||
fi
|
fi
|
||||||
- it: it does not chown /data even when image.fullOverride is set
|
- it: it does not chown /data even when image.fullOverride is set
|
||||||
template: templates/gitea/init.yaml
|
template: templates/gitea/secret_init.yaml
|
||||||
set:
|
set:
|
||||||
image.fullOverride: docker.gitea.com/gitea:1.20.5
|
image.fullOverride: docker.gitea.com/gitea:1.20.5
|
||||||
asserts:
|
asserts:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/init.yaml
|
- templates/gitea/secret_init.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: runs gpg in batch mode
|
- it: runs gpg in batch mode
|
||||||
set:
|
set:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/metrics-secret.yaml
|
- templates/gitea/secret_metrics.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: renders nothing if monitoring disabled and gitea.metrics.token empty
|
- it: renders nothing if monitoring disabled and gitea.metrics.token empty
|
||||||
set:
|
set:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/metrics-secret.yaml
|
- templates/gitea/secret_metrics.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: renders nothing if monitoring enabled and gitea.metrics.token empty
|
- it: renders nothing if monitoring enabled and gitea.metrics.token empty
|
||||||
set:
|
set:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/pvc.yaml
|
- templates/gitea/persistentVolumeClaim.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: Storage Class using TPL
|
- it: Storage Class using TPL
|
||||||
set:
|
set:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/serviceaccount.yaml
|
- templates/gitea/serviceAccount.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: skips rendering by default
|
- it: skips rendering by default
|
||||||
asserts:
|
asserts:
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/serviceaccount.yaml
|
- templates/gitea/serviceAccount.yaml
|
||||||
- templates/gitea/deployment.yaml
|
- templates/gitea/deployment.yaml
|
||||||
- templates/gitea/config.yaml
|
- templates/gitea/secret_config.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: does not modify the deployment by default
|
- it: does not modify the deployment by default
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/servicemonitor.yaml
|
- templates/gitea/serviceMonitor.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: skips rendering by default
|
- it: skips rendering by default
|
||||||
asserts:
|
asserts:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/servicemonitor.yaml
|
- templates/gitea/serviceMonitor.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: renders nothing if gitea.metrics.serviceMonitor disabled and gitea.metrics.token empty
|
- it: renders nothing if gitea.metrics.serviceMonitor disabled and gitea.metrics.token empty
|
||||||
set:
|
set:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ release:
|
|||||||
name: gitea-unittests
|
name: gitea-unittests
|
||||||
namespace: testing
|
namespace: testing
|
||||||
templates:
|
templates:
|
||||||
- templates/gitea/servicemonitor.yaml
|
- templates/gitea/serviceMonitor.yaml
|
||||||
tests:
|
tests:
|
||||||
- it: renders unsecure ServiceMonitor if gitea.metrics.token nil
|
- it: renders unsecure ServiceMonitor if gitea.metrics.token nil
|
||||||
set:
|
set:
|
||||||
|
|||||||
Reference in New Issue
Block a user