Skip to content

Commit

Permalink
add sentinel support for chartmuseum
Browse files Browse the repository at this point in the history
Signed-off-by: Ziming Zhang <zziming@vmware.com>
  • Loading branch information
bitsf committed Dec 23, 2020
1 parent d1b652e commit 25b539b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
run: |
export GITHUB_TOKEN=xxx
set -ex
kubectl apply -f manifests/samples/full_stack_fs.yaml
kubectl apply -f manifests/samples/full_stack_other_fs.yaml
for i in $(seq 1 6);do
sleep 30
echo $i
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
sudo kubectl port-forward -n ingress-nginx service/ingress-nginx-controller 443:443 80:80 --address=0.0.0.0 &
sleep 10
echo 127.0.0.1 core.harbor.domain | sudo tee -a /etc/hosts
curl https://core.harbor.domain/api/v2.0/systeminfo -i -k
curl https://core.harbor.domain/api/v2.0/systeminfo -i -k -f
mkdir -p ~/.docker/tls/core.harbor.domain
kubectl -n cluster-sample-ns get secret sample-public-certificate -o jsonpath='{.data.ca\.crt}' \
| base64 --decode \
Expand Down
17 changes: 13 additions & 4 deletions config/config/assets/chartmuseum-config.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,22 @@ bearer.auth: 1
{{- end }}

{{- if .Spec.Cache.Redis }}
{{- if .Spec.Cache.Redis.SentinelMasterSet }}
cache: redis_sentinel
{{- else }}
cache: redis
{{- end }}
cache.redis:
{{- with (.Spec.Cache.Redis.GetDSN "") }}
addr: {{ quote .Host }}
# password: Will be set with environment variable
db: {{ .EscapedPath | trimAll "/" }}
{{- if .Spec.Cache.Redis.SentinelMasterSet }}
mastername: {{ .Spec.Cache.Redis.SentinelMasterSet | quote }}
{{- end }}
{{- if .Spec.Cache.Redis.Port }}
addr: {{ printf "%s:%d" .Spec.Cache.Redis.Host .Spec.Cache.Redis.Port | quote }}
{{- else }}
addr: {{ .Spec.Cache.Redis.Host | quote }}
{{- end }}
# password: setted through environment variable
db: {{ .Spec.Cache.Redis.Database }}
{{- end }}

context.path: ''
Expand Down

0 comments on commit 25b539b

Please sign in to comment.