Add non-clustered redis as sub-chart #672
@ -113,7 +113,9 @@ app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "redis.dns" -}}
|
||||
{{- if (index .Values "redis-cluster").enabled -}}
|
||||
{{- if and ((index .Values "redis-cluster").enabled) ((index .Values "redis").enabled) -}}
|
||||
{{- fail "redis AND redis-cluster can't be both enabled" -}}
|
||||
{{- else if (index .Values "redis-cluster").enabled -}}
|
||||
{{- printf "redis+cluster://:%s@%s-redis-cluster-headless.%s.svc.%s:%g/0?pool_size=100&idle_timeout=180s&" (index .Values "redis-cluster").global.redis.password .Release.Name .Release.Namespace .Values.clusterDomain (index .Values "redis-cluster").service.ports.redis -}}
|
||||
{{- else if (index .Values "redis").enabled -}}
|
||||
{{- printf "redis://:%s@%s-redis-headless.%s.svc.%s:%g/0?pool_size=100&idle_timeout=180s&" (index .Values "redis").global.redis.password .Release.Name .Release.Namespace .Values.clusterDomain (index .Values "redis").master.service.ports.redis -}}
|
||||
|
@ -8,6 +8,8 @@ tests:
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: true
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
@ -16,11 +18,28 @@ tests:
|
||||
ADAPTER=redis
|
||||
HOST=redis+cluster://:@gitea-unittests-redis-cluster-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
|
||||
- it: "cache is configured correctly for 'memory' when redis-cluster is disabled"
|
||||
- it: "cache is configured correctly for redis"
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.cache
|
||||
value: |-
|
||||
ADAPTER=redis
|
||||
HOST=redis://:changeme@gitea-unittests-redis-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
|
||||
- it: "cache is configured correctly for 'memory' when redis (or redis-cluster) is disabled"
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
@ -29,11 +48,13 @@ tests:
|
||||
ADAPTER=memory
|
||||
HOST=
|
||||
|
||||
- it: "cache can be customized when redis-cluster is disabled"
|
||||
- it: "cache can be customized when redis (or redis-cluster) is disabled"
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: false
|
||||
gitea.config.cache.ADAPTER: custom-adapter
|
||||
gitea.config.cache.HOST: custom-host
|
||||
asserts:
|
||||
|
@ -8,6 +8,8 @@ tests:
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: true
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
@ -16,11 +18,28 @@ tests:
|
||||
CONN_STR=redis+cluster://:@gitea-unittests-redis-cluster-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
TYPE=redis
|
||||
|
||||
- it: "queue is configured correctly for 'levelDB' when redis-cluster is disabled"
|
||||
- it: "queue is configured correctly for redis"
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.queue
|
||||
value: |-
|
||||
CONN_STR=redis://:changeme@gitea-unittests-redis-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
TYPE=redis
|
||||
|
||||
- it: "queue is configured correctly for 'levelDB' when redis (and redis-cluster) is disabled"
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
@ -29,11 +48,13 @@ tests:
|
||||
CONN_STR=
|
||||
TYPE=level
|
||||
|
||||
- it: "queue can be customized when redis-cluster is disabled"
|
||||
- it: "queue can be customized when redis (and redis-cluster) is disabled"
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: false
|
||||
gitea.config.queue.TYPE: custom-type
|
||||
gitea.config.queue.CONN_STR: custom-connection-string
|
||||
asserts:
|
||||
|
@ -8,6 +8,8 @@ tests:
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: true
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
@ -16,11 +18,28 @@ tests:
|
||||
PROVIDER=redis
|
||||
PROVIDER_CONFIG=redis+cluster://:@gitea-unittests-redis-cluster-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
|
||||
- it: "session is configured correctly for 'memory' when redis-cluster is disabled"
|
||||
- it: "session is configured correctly for redis"
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.session
|
||||
value: |-
|
||||
PROVIDER=redis
|
||||
PROVIDER_CONFIG=redis://:changeme@gitea-unittests-redis-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
|
||||
- it: "session is configured correctly for 'memory' when redis (and redis-cluster) is disabled"
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
@ -29,11 +48,13 @@ tests:
|
||||
PROVIDER=memory
|
||||
PROVIDER_CONFIG=
|
||||
|
||||
- it: "session can be customized when redis-cluster is disabled"
|
||||
- it: "session can be customized when redis (and redis-cluster) is disabled"
|
||||
template: templates/gitea/config.yaml
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: false
|
||||
redis:
|
||||
enabled: false
|
||||
gitea.config.session.PROVIDER: custom-provider
|
||||
gitea.config.session.PROVIDER_CONFIG: custom-provider-config
|
||||
asserts:
|
||||
|
@ -34,6 +34,8 @@ tests:
|
||||
set:
|
||||
redis-cluster:
|
||||
enabled: true
|
||||
redis:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
|
Loading…
x
Reference in New Issue
Block a user