Skip to content

Commit

Permalink
Merge pull request #15 from SunSince90/remove-default-etcd-password
Browse files Browse the repository at this point in the history
Remove default etcd password
  • Loading branch information
ljakab authored Dec 13, 2021
2 parents d750bb5 + 004fd3b commit 8c12ca6
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*.lock
**/*.tgz
2 changes: 1 addition & 1 deletion charts/cnwan-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
appVersion: "v0.7.0"
version: "1.2.0"
version: "1.2.1"
type: application
name: cnwan-operator
description: |
Expand Down
3 changes: 3 additions & 0 deletions charts/cnwan-operator/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ For brevity, some of the values here have been omitted and their default values
will apply in that case. Please refer to the [values table](#values-table)
above if you want to add other values and to know what they mean.

Remember that you need to provide a password for communication with etcd to
work correctly. Look at the example below to understand how to do that.

#### Installing the operator and etcd

To deploy the operator and etcd together, you can run
Expand Down
1 change: 1 addition & 0 deletions charts/cnwan-operator/ci/install-etcd-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ operator:
serviceRegistry: etcd
etcd:
install: true
password: dem0-pwd
7 changes: 7 additions & 0 deletions charts/cnwan-operator/templates/etcd_credentials.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{{- if and (eq .Values.operator.serviceRegistry "etcd") (or (.Values.operator.etcd.username) (.Values.operator.etcd.password)) }}

{{- if (and (.Values.operator.etcd.username) (not .Values.operator.etcd.password) ) }}
{{- fail "etcd password not provided" }}
{{- end }}
{{- if (and (not .Values.operator.etcd.username) (.Values.operator.etcd.password) ) }}
{{- fail "etcd username not provided" }}
{{- end }}
apiVersion: v1
kind: Secret
metadata:
Expand Down
6 changes: 3 additions & 3 deletions charts/cnwan-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ operator:
# operator.etcd.username -- The username to connect as.
username: root

# operator.etcd.username -- The password to use for the username provided
# in `operator.etcd.username`.
password: "dem0-pwd"
# operator.etcd.password -- The password to use for the username provided
# in `operator.etcd.password`. The chart won't deploy if this is empty.
password: ""

# operator.etcd.prefix -- The prefix that all keys will share.
prefix: "/service-registry"
Expand Down

0 comments on commit 8c12ca6

Please sign in to comment.