Skip to content

Commit 8b091f7

Browse files
authored
Merge pull request #11 from chatwork/refactor-secret
Refactor secret values
2 parents 69f7e58 + bd1df7d commit 8b091f7

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

charts/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A Helm chart for [chatwork/sendgrid-stats-exporter](https://github.com/chatwork/
66
## Installing the Chart
77

88
```
9-
$ helm install --set 'deployment.secret.apiKey=secret' --set 'deployment.secret.username=username' sendgrid-stats-exporter ./
9+
$ helm install --set 'secret.apiKey=secret' --set 'secret.username=username' sendgrid-stats-exporter ./
1010
```
1111

1212
```
@@ -39,8 +39,8 @@ The following table lists the configurable parameters of the Sendgrid-stats-expo
3939
| `podSecurityContext` | Security context for the pod | `{}` |
4040
| `securityContext` | Security context for container | `{}` |
4141
| `envFrom` | Extra custom environment variables from ConfigMaps | `[]` |
42-
| `deployment.secret.apiKey` | SendGrid api token | `{}` |
43-
| `deployment.secret.username` | SendGrid username | `[]` |
42+
| `secret.apiKey` | SendGrid api token | `{}` |
43+
| `secret.username` | SendGrid username | `[]` |
4444
| `service.type` | Service Type | `"ClusterIP"` |
4545
| `service.port` | Service port | `9154` |
4646
| `ingress.enabled` | If true, enable Ingress | `false` |

charts/templates/_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ Create the name of the service account to use
6565
Return secret name to be used based on provided values.
6666
*/}}
6767
{{- define "sendgrid-stats-exporter.secretName" -}}
68-
{{- if not .Values.deployment.secret.existingSecretName -}}
68+
{{- if not .Values.secret.existingSecretName -}}
6969
{{ default (printf "%s-secret" (include "sendgrid-stats-exporter.fullname" . )) }}
7070
{{- else -}}
71-
{{ .Values.deployment.secret.existingSecretName }}
71+
{{ .Values.secret.existingSecretName }}
7272
{{- end -}}
7373
{{- end -}}

charts/templates/secret.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ metadata:
66
{{- include "sendgrid-stats-exporter.labels" . | nindent 4 }}
77
type: Opaque
88
data:
9-
username: {{ .Values.deployment.secret.username | b64enc | quote }}
10-
apiKey: {{ .Values.deployment.secret.apiKey | b64enc | quote }}
9+
username: {{ .Values.secret.username | b64enc | quote }}
10+
apiKey: {{ .Values.secret.apiKey | b64enc | quote }}

charts/values.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ securityContext: {}
2929

3030
envFrom: []
3131

32-
deployment:
33-
secret:
34-
existingSecretName:
35-
username: ""
36-
apiKey: ""
32+
secret:
33+
existingSecretName:
34+
username: ""
35+
apiKey: ""
3736

3837
service:
3938
type: ClusterIP

0 commit comments

Comments
 (0)