diff --git a/README.md b/README.md index bb68277..a4750ea 100644 --- a/README.md +++ b/README.md @@ -150,14 +150,15 @@ $ helm install npm -f values.yaml verdaccio/verdaccio This requires helm v3.2.0 or above. You can list all username and password in `.Values.secrets.htpasswd`. Helm will generate secret with htpaswd format. This file is mounted on pod in this path `/verdaccio/auth/htpasswd`. The Default -config uses this. +config uses this. The conditional statement `{{- if .Values.secrets.htpasswd }}` +is evaluated as false if the list is an empty collection. +(Source [helm flow control](https://helm.sh/docs/chart_template_guide/control_structures/#ifelse)) -> **Tip**: These values are in plaintext. So don't forget to put aditional +> **Tip**: These values are in plaintext. So don't forget to put additional > encryption. #### Example ```yaml -useSecretHtpasswd: true secrets: # list of users and password for htpasswd plugin # This this is mounted as /verdaccio/auth/htpasswd on pods diff --git a/charts/verdaccio/Chart.yaml b/charts/verdaccio/Chart.yaml index 0fdc28c..eb30110 100644 --- a/charts/verdaccio/Chart.yaml +++ b/charts/verdaccio/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: A lightweight private node.js proxy registry name: verdaccio -version: 4.2.0 +version: 4.3.0 appVersion: 5.1.1 home: https://verdaccio.org icon: https://cdn.verdaccio.dev/logos/default.png diff --git a/charts/verdaccio/templates/deployment.yaml b/charts/verdaccio/templates/deployment.yaml index 277842a..c0af8de 100644 --- a/charts/verdaccio/templates/deployment.yaml +++ b/charts/verdaccio/templates/deployment.yaml @@ -67,7 +67,7 @@ spec: - mountPath: /verdaccio/storage name: storage readOnly: false - {{- if .Values.useSecretHtpasswd }} + {{- if .Values.secrets.htpasswd }} - mountPath: /verdaccio/storage/htpasswd name: htpasswd subPath: htpasswd @@ -84,7 +84,7 @@ spec: - name: config configMap: name: {{ .Values.existingConfigMap | default (include "verdaccio.fullname" .) }} - {{- if .Values.useSecretHtpasswd }} + {{- if .Values.secrets.htpasswd }} - name: htpasswd secret: secretName: {{ include "verdaccio.fullname" . }}-htpasswd diff --git a/charts/verdaccio/templates/htpasswd-secret.yaml b/charts/verdaccio/templates/htpasswd-secret.yaml index e811ca9..48a6f6c 100644 --- a/charts/verdaccio/templates/htpasswd-secret.yaml +++ b/charts/verdaccio/templates/htpasswd-secret.yaml @@ -1,4 +1,4 @@ -{{- if .Values.useSecretHtpasswd }} +{{- if .Values.secrets.htpasswd }} apiVersion: v1 kind: Secret type: Opaque diff --git a/charts/verdaccio/values.yaml b/charts/verdaccio/values.yaml index 2b1c896..4c42d3e 100644 --- a/charts/verdaccio/values.yaml +++ b/charts/verdaccio/values.yaml @@ -208,9 +208,6 @@ priorityClass: existingConfigMap: false -# use htpasswd secrets -useSecretHtpasswd: false - # Secrets secrets: # list of users and password for htpasswd plugin