Skip to content

Commit

Permalink
rename secret data keys, add test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Nov 14, 2024
1 parent f918a60 commit adf96f2
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 4 deletions.
4 changes: 2 additions & 2 deletions charts/cryostat/templates/alpha_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ data:
{{- end}}
TLS:
Key:
fromFile: /etc/tls/private/KEY
fromFile: /etc/tls/private/key
Cert:
fromFile: /etc/tls/private/CERT
fromFile: /etc/tls/private/cert
upstreamConfig:
proxyRawPath: true
upstreams:
Expand Down
4 changes: 2 additions & 2 deletions charts/cryostat/templates/cryostat_tls_secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ metadata:
type: Opaque
immutable: true
data:
CERT: {{ $cert.Cert | b64enc }}
KEY: {{ $cert.Key | b64enc }}
cert: {{ $cert.Cert | b64enc }}
key: {{ $cert.Key | b64enc }}
{{- end -}}
47 changes: 47 additions & 0 deletions charts/cryostat/tests/cryostat_tls_secret_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
suite: test cryostat_tls_secret.yaml
templates:
- cryostat_tls_secret.yaml

tests:
- it: should create a TLS cert secret if oauth2Proxy.service.tls.selfSigned.enabled is set
set:
oauth2Proxy:
service:
tls:
selfSigned:
enabled: true
asserts:
- hasDocuments:
count: 1
- equal:
path: kind
value: Secret
- equal:
path: metadata.name
value: RELEASE-NAME-oauth2proxy-tls
- equal:
path: type
value: Opaque
- exists:
path: data.key
- exists:
path: data.cert
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: cryostat
app.kubernetes.io/version: 4.0.0-dev
helm.sh/chart: cryostat-2.0.0-dev

- it: should not create a TLS cert secret if oauth2Proxy.service.tls.selfSigned.enabled is not set
set:
oauth2Proxy:
service:
tls:
selfSigned:
enabled: false
asserts:
- hasDocuments:
count: 0

0 comments on commit adf96f2

Please sign in to comment.