Skip to content

Commit

Permalink
checking array if empty to remove redundant flag (#72)
Browse files Browse the repository at this point in the history
* checking array if empty to remove redundant flag

* version bump to 4.2.1

* breaking change bump to 4.3.0 deprecating .Values.useSecretHtpasswd flag

* readme upadate, on htpasswd flow control, list evaluation

* Update README.md

Co-authored-by: BulanArthur <[email protected]>
  • Loading branch information
arthur2308 and BulanArthur authored Jul 29, 2021
1 parent aaa72b1 commit 96b7374
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/verdaccio/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions charts/verdaccio/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/verdaccio/templates/htpasswd-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.useSecretHtpasswd }}
{{- if .Values.secrets.htpasswd }}
apiVersion: v1
kind: Secret
type: Opaque
Expand Down
3 changes: 0 additions & 3 deletions charts/verdaccio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ priorityClass:

existingConfigMap: false

# use htpasswd secrets
useSecretHtpasswd: false

# Secrets
secrets:
# list of users and password for htpasswd plugin
Expand Down

0 comments on commit 96b7374

Please sign in to comment.