mirror of
https://github.com/bitnami/charts.git
synced 2026-03-27 15:27:10 +08:00
[bitnami/harbor] Fix redis address if using sentinel (#17867)
* [bitnami/harbor] Fix redis address if using sentinel Signed-off-by: Adrian Berger <adria.berger94@gmail.com> * Fix conflicts Signed-off-by: Adrian Berger <adrian.berger@bedag.ch> --------- Signed-off-by: Adrian Berger <adria.berger94@gmail.com> Signed-off-by: Adrian Berger <43774417+adberger@users.noreply.github.com> Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>
This commit is contained in:
@@ -59,4 +59,4 @@ maintainers:
|
||||
name: harbor
|
||||
sources:
|
||||
- https://github.com/bitnami/charts/tree/main/bitnami/harbor
|
||||
version: 16.7.3
|
||||
version: 16.7.4
|
||||
|
||||
@@ -204,11 +204,15 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
|
||||
{{- end -}}
|
||||
|
||||
{{- define "harbor.redis.host" -}}
|
||||
{{- ternary (ternary (printf "%s/%s" (printf "%s-headless:%d" (include "harbor.redis.fullname" .) (int64 .Values.redis.sentinel.service.ports.sentinel)) .Values.redis.sentinel.masterSet) (printf "%s-master" (include "harbor.redis.fullname" .)) .Values.redis.sentinel.enabled) (ternary (printf "%s/%s" .Values.externalRedis.sentinel.hosts .Values.externalRedis.sentinel.masterSet) .Values.externalRedis.host .Values.externalRedis.sentinel.enabled) .Values.redis.enabled -}}
|
||||
{{- ternary (ternary (printf "%s-headless" (include "harbor.redis.fullname" .)) (printf "%s-master" (include "harbor.redis.fullname" .)) .Values.redis.sentinel.enabled) (ternary (printf "%s" .Values.externalRedis.sentinel.hosts) .Values.externalRedis.host .Values.externalRedis.sentinel.enabled) .Values.redis.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "harbor.redis.port" -}}
|
||||
{{- ternary "6379" .Values.externalRedis.port .Values.redis.enabled -}}
|
||||
{{- ternary (ternary (int64 .Values.redis.sentinel.service.ports.sentinel) "6379" .Values.redis.sentinel.enabled) .Values.externalRedis.port .Values.redis.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "harbor.redis.sentinel.masterSet" -}}
|
||||
{{- ternary (ternary (printf "%s" .Values.redis.sentinel.masterSet) ("") .Values.redis.sentinel.enabled) (ternary (printf "%s" .Values.externalRedis.sentinel.masterSet) ("") .Values.externalRedis.sentinel.enabled) .Values.redis.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "harbor.redis.coreDatabaseIndex" -}}
|
||||
@@ -261,9 +265,9 @@ Return whether Redis® uses password authentication or not
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if (include "harbor.redis.escapedRawPassword" . ) -}}
|
||||
{{- printf "redis+sentinel://default:%s@%s/%s" (include "harbor.redis.escapedRawPassword" . ) (include "harbor.redis.host" . ) (include "harbor.redis.jobserviceDatabaseIndex" . ) -}}
|
||||
{{- printf "redis+sentinel://default:%s@%s:%s/%s/%s" (include "harbor.redis.escapedRawPassword" . ) (include "harbor.redis.host" . ) (include "harbor.redis.port" . ) (include "harbor.redis.sentinel.masterSet" . ) (include "harbor.redis.jobserviceDatabaseIndex" . ) -}}
|
||||
{{- else -}}
|
||||
{{- printf "redis+sentinel://%s/%s" (include "harbor.redis.host" . ) (include "harbor.redis.jobserviceDatabaseIndex" . ) -}}
|
||||
{{- printf "redis+sentinel://%s:%s/%s/%s" (include "harbor.redis.host" . ) (include "harbor.redis.port" . ) (include "harbor.redis.sentinel.masterSet" . ) (include "harbor.redis.jobserviceDatabaseIndex" . ) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -278,9 +282,9 @@ Return whether Redis® uses password authentication or not
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if (include "harbor.redis.escapedRawPassword" . ) -}}
|
||||
{{- printf "redis+sentinel://default:%s@%s/%s" (include "harbor.redis.escapedRawPassword" . ) (include "harbor.redis.host" . ) (include "harbor.redis.registryDatabaseIndex" . ) -}}
|
||||
{{- printf "redis+sentinel://default:%s@%s:%s/%s/%s" (include "harbor.redis.escapedRawPassword" . ) (include "harbor.redis.host" . ) (include "harbor.redis.port" . ) (include "harbor.redis.sentinel.masterSet" . ) (include "harbor.redis.registryDatabaseIndex" . ) -}}
|
||||
{{- else -}}
|
||||
{{- printf "redis+sentinel://%s/%s" (include "harbor.redis.host" . ) (include "harbor.redis.registryDatabaseIndex" . ) -}}
|
||||
{{- printf "redis+sentinel://%s:%s/%s/%s" (include "harbor.redis.host" . ) (include "harbor.redis.port" . ) (include "harbor.redis.sentinel.masterSet" . ) (include "harbor.redis.registryDatabaseIndex" . ) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -294,9 +298,9 @@ Return whether Redis® uses password authentication or not
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if (include "harbor.redis.escapedRawPassword" . ) -}}
|
||||
{{- printf "redis+sentinel://default:%s@%s/%s" (include "harbor.redis.escapedRawPassword" . ) (include "harbor.redis.host" . ) (include "harbor.redis.trivyAdapterDatabaseIndex" . ) -}}
|
||||
{{- printf "redis+sentinel://default:%s@%s:%s/%s/%s" (include "harbor.redis.escapedRawPassword" . ) (include "harbor.redis.host" . ) (include "harbor.redis.port" . ) (include "harbor.redis.sentinel.masterSet" . ) (include "harbor.redis.trivyAdapterDatabaseIndex" . ) -}}
|
||||
{{- else -}}
|
||||
{{- printf "redis+sentinel://%s/%s" (include "harbor.redis.host" . ) (include "harbor.redis.trivyAdapterDatabaseIndex" . ) -}}
|
||||
{{- printf "redis+sentinel://%s:%s/%s/%s" (include "harbor.redis.host" . ) (include "harbor.redis.port" . ) (include "harbor.redis.sentinel.masterSet" . ) (include "harbor.redis.trivyAdapterDatabaseIndex" . ) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -310,9 +314,9 @@ Return whether Redis® uses password authentication or not
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if (include "harbor.redis.escapedRawPassword" . ) -}}
|
||||
{{- printf "redis+sentinel://default:%s@%s/%s" (include "harbor.redis.escapedRawPassword" . ) (include "harbor.redis.host" . ) (include "harbor.redis.coreDatabaseIndex" . ) -}}
|
||||
{{- printf "redis+sentinel://default:%s@%s:%s/%s/%s" (include "harbor.redis.escapedRawPassword" . ) (include "harbor.redis.host" . ) (include "harbor.redis.port" . ) (include "harbor.redis.sentinel.masterSet" . ) (include "harbor.redis.coreDatabaseIndex" . ) -}}
|
||||
{{- else -}}
|
||||
{{- printf "redis+sentinel://%s/%s" (include "harbor.redis.host" . ) (include "harbor.redis.coreDatabaseIndex" . ) -}}
|
||||
{{- printf "redis+sentinel://%s:%s/%s/%s" (include "harbor.redis.host" . ) (include "harbor.redis.port" . ) (include "harbor.redis.sentinel.masterSet" . ) (include "harbor.redis.coreDatabaseIndex" . ) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -162,6 +162,9 @@ data:
|
||||
disable: {{ .Values.persistence.imageChartStorage.disableredirect }}
|
||||
redis:
|
||||
addr: "{{ template "harbor.redis.host" . }}:{{ template "harbor.redis.port" . }}"
|
||||
{{- if ne "" (include "harbor.redis.sentinel.masterSet" .) }}
|
||||
sentinelMasterSet: "{{ template "harbor.redis.sentinel.masterSet" . }}"
|
||||
{{- end }}
|
||||
db: {{ template "harbor.redis.registryDatabaseIndex" . }}
|
||||
http:
|
||||
relativeurls: {{ .Values.registry.relativeurls }}
|
||||
|
||||
Reference in New Issue
Block a user