Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify admin hash in the secret #106

Merged
merged 6 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion couchdb/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: couchdb
version: 3.6.4
version: 4.0.0
appVersion: 3.2.1
description: A database featuring seamless multi-master sync, that scales from
big data to mobile, with an intuitive HTTP/JSON API and designed for
Expand Down
4 changes: 4 additions & 0 deletions couchdb/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# NEWS

## 4.0.0

- Simplified the `adminHash` in the secret

# 3.6.4

- Add `service.labels` value to pass along labels to the client-facing service
Expand Down
143 changes: 71 additions & 72 deletions couchdb/README.md

Large diffs are not rendered by default.

134 changes: 67 additions & 67 deletions couchdb/README.md.gotmpl

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions couchdb/password.ini

This file was deleted.

2 changes: 1 addition & 1 deletion couchdb/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ data:
erlangCookie: {{ template "couchdb.defaultsecret-stateful" $erlangCookieArgs }}
cookieAuthSecret: {{ template "couchdb.defaultsecret" .Values.cookieAuthSecret }}
{{- if .Values.adminHash }}
password.ini: {{ tpl (.Files.Get "password.ini") . | b64enc }}
adminHash: {{ .Values.adminHash | b64enc | quote }}
{{- end -}}
{{- end -}}
19 changes: 12 additions & 7 deletions couchdb/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,19 @@ spec:
- name: admin-hash-copy
image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}"
imagePullPolicy: {{ .Values.initImage.pullPolicy }}
command: ['sh','-c','cp /tmp/password.ini /local.d/ ;']
env:
- name: "ADMINUSERNAME"
valueFrom:
secretKeyRef:
name: {{ template "couchdb.fullname" . }}
key: adminUsername
- name: "ADMINHASH"
valueFrom:
secretKeyRef:
name: {{ template "couchdb.fullname" . }}
key: adminHash
command: ['sh','-c','echo -e "[admins]\n$ADMINUSERNAME = $ADMINHASH" > /local.d/password.ini ;']
volumeMounts:
- name: admin-password
mountPath: /tmp/password.ini
subPath: "password.ini"
- name: local-config-storage
mountPath: /local.d
{{- end }}
Expand Down Expand Up @@ -194,9 +202,6 @@ spec:
{{- if .Values.adminHash }}
- name: local-config-storage
emptyDir: {}
- name: admin-password
secret:
secretName: {{ template "couchdb.fullname" . }}
{{- end -}}

{{- if not .Values.persistentVolume.enabled }}
Expand Down