Add config fallbacks for session, cache and queue when disabling redis-cluster (#585) All checks were successful check-and-test / check-and-test (push) Successful in 31s
All checks were successful
check-and-test / check-and-test (push) Successful in 31s
### Description of the change Add config fallbacks for `session`, `cache` and `queue` including tests. ### Benefits If users disable the default `redis-cluster` sub-chart dependency, this will configure the respective sections to use the Gitea defaults as listed in https://docs.gitea.com/next/administration/config-cheat-sheet. ### Possible drawbacks Users will run on non-optimal settings for production without knowing their config. ### Applicable issues - fixes #584 #573 #489 #476 #468 #453 ### Checklist <!-- [Place an '[X]' (no spaces) in all applicable fields. Please remove unrelated fields.] --> - [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` - [x] Templating unittests are added Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com> Co-authored-by: justusbunsi <justusbunsi@noreply.gitea.com> Reviewed-on: gitea/helm-chart#585 Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.com>
This commit was merged in pull request #585.
This commit is contained in:
@@ -18,3 +18,19 @@ | ||||
echo "Visit http://127.0.0.1:{{ .Values.service.http.port }} to use your application" | ||||
kubectl --namespace {{ .Release.Namespace }} port-forward svc/{{ .Release.Name }}-http {{ .Values.service.http.port }}:{{ .Values.service.http.port }} | ||||
{{- end }} | ||||
{{- $warnings := list -}} | ||||
{{- if eq (get .Values.gitea.config.cache "ADAPTER") "memory" -}} | ||||
{{- $warnings = append $warnings "Gitea uses 'memory' for caching which is not recommended for production use. See https://docs.gitea.com/next/administration/config-cheat-sheet#cache-cache for available options." -}} | ||||
{{- end }} | ||||
{{- if eq (get .Values.gitea.config.queue "TYPE") "level" -}} | ||||
{{- $warnings = append $warnings "Gitea uses 'leveldb' for queue actions which is not recommended for production use. See https://docs.gitea.com/next/administration/config-cheat-sheet#queue-queue-and-queue for available options." -}} | ||||
{{- end }} | ||||
{{- if eq (get .Values.gitea.config.session "PROVIDER") "memory" -}} | ||||
{{- $warnings = append $warnings "Gitea uses 'memory' for sessions which is not recommended for production use. See https://docs.gitea.com/next/administration/config-cheat-sheet#session-session for available options." -}} | ||||
{{- end }} | ||||
{{- if gt (len $warnings) 0 }} | ||||
2. Review these warnings: | ||||
{{- range $warnings }} | ||||
- {{ . }} | ||||
{{- end }} | ||||
{{- end }} | ||||
| ||||
@@ -290,23 +290,33 @@ https | ||||
{{- if not (hasKey .Values.gitea.config.metrics "ENABLED") -}} | ||||
{{- $_ := set .Values.gitea.config.metrics "ENABLED" .Values.gitea.metrics.enabled -}} | ||||
{{- end -}} | ||||
{{- if (index .Values "redis-cluster").enabled -}} | ||||
{{- $_ := set .Values.gitea.config.cache "ENABLED" "true" -}} | ||||
{{- $_ := set .Values.gitea.config.cache "ADAPTER" "redis" -}} | ||||
{{- if not (.Values.gitea.config.cache.HOST) -}} | ||||
{{- $_ := set .Values.gitea.config.cache "HOST" (include "redis.dns" .) -}} | ||||
{{- end -}} | ||||
{{- end -}} | ||||
{{- /* redis queue */ -}} | ||||
{{- if (index .Values "redis-cluster").enabled -}} | ||||
{{- $_ := set .Values.gitea.config.queue "TYPE" "redis" -}} | ||||
{{- $_ := set .Values.gitea.config.queue "CONN_STR" (include "redis.dns" .) -}} | ||||
{{- end -}} | ||||
{{- if not (get .Values.gitea.config.session "PROVIDER") -}} | ||||
{{- $_ := set .Values.gitea.config.session "PROVIDER" "redis" -}} | ||||
{{- end -}} | ||||
{{- if not (get .Values.gitea.config.session "PROVIDER_CONFIG") -}} | ||||
{{- $_ := set .Values.gitea.config.session "PROVIDER_CONFIG" (include "redis.dns" .) -}} | ||||
{{- $_ := set .Values.gitea.config.cache "ADAPTER" "redis" -}} | ||||
{{- $_ := set .Values.gitea.config.cache "HOST" (include "redis.dns" .) -}} | ||||
{{- else -}} | ||||
{{- if not (get .Values.gitea.config.session "PROVIDER") -}} | ||||
{{- $_ := set .Values.gitea.config.session "PROVIDER" "memory" -}} | ||||
{{- end -}} | ||||
{{- if not (get .Values.gitea.config.session "PROVIDER_CONFIG") -}} | ||||
{{- $_ := set .Values.gitea.config.session "PROVIDER_CONFIG" "" -}} | ||||
{{- end -}} | ||||
{{- if not (get .Values.gitea.config.queue "TYPE") -}} | ||||
{{- $_ := set .Values.gitea.config.queue "TYPE" "level" -}} | ||||
{{- end -}} | ||||
{{- if not (get .Values.gitea.config.queue "CONN_STR") -}} | ||||
{{- $_ := set .Values.gitea.config.queue "CONN_STR" "" -}} | ||||
{{- end -}} | ||||
{{- if not (get .Values.gitea.config.cache "ADAPTER") -}} | ||||
{{- $_ := set .Values.gitea.config.cache "ADAPTER" "memory" -}} | ||||
{{- end -}} | ||||
{{- if not (get .Values.gitea.config.cache "HOST") -}} | ||||
{{- $_ := set .Values.gitea.config.cache "HOST" "" -}} | ||||
{{- end -}} | ||||
{{- end -}} | ||||
{{- if not .Values.gitea.config.indexer.ISSUE_INDEXER_TYPE -}} | ||||
{{- $_ := set .Values.gitea.config.indexer "ISSUE_INDEXER_TYPE" "db" -}} | ||||
| ||||
Reference in New Issue
Block a user