You've already forked reposilite-charts
feat(secret): support annotations and labels for the basic auth secret
All checks were successful
Helm / helm-lint (push) Successful in 6s
Helm / helm-unittest (push) Successful in 6s
Generate README / generate-parameters (push) Successful in 28s
Markdown linter / markdown-link-checker (push) Successful in 18s
Release / publish-chart (push) Successful in 8s
Markdown linter / markdown-lint (push) Successful in 28s
All checks were successful
Helm / helm-lint (push) Successful in 6s
Helm / helm-unittest (push) Successful in 6s
Generate README / generate-parameters (push) Successful in 28s
Markdown linter / markdown-link-checker (push) Successful in 18s
Release / publish-chart (push) Successful in 8s
Markdown linter / markdown-lint (push) Successful in 28s
This commit is contained in:
78
unittests/secrets/basicAuth.yaml
Normal file
78
unittests/secrets/basicAuth.yaml
Normal file
@@ -0,0 +1,78 @@
|
||||
chart:
|
||||
appVersion: 0.1.0
|
||||
version: 0.1.0
|
||||
suite: Secret reposilite template
|
||||
release:
|
||||
name: reposilite-unittest
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/secretPrometheusBasicAuth.yaml
|
||||
tests:
|
||||
- it: Skip rendering
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: Rendering secret with default values.
|
||||
set:
|
||||
prometheus.metrics.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- containsDocument:
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
name: reposilite-unittest-basic-auth-credentials
|
||||
namespace: testing
|
||||
- notExists:
|
||||
path: metadata.annotations
|
||||
- equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: reposilite-unittest
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: reposilite
|
||||
app.kubernetes.io/version: 0.1.0
|
||||
helm.sh/chart: reposilite-0.1.0
|
||||
- exists:
|
||||
path: stringData.password
|
||||
- exists:
|
||||
path: stringData.username
|
||||
|
||||
- it: Rendering secret with custom values.
|
||||
set:
|
||||
prometheus.metrics.enabled: true
|
||||
prometheus.metrics.secret.new.basicAuthPassword: foo
|
||||
prometheus.metrics.secret.new.basicAuthUsername: bar
|
||||
prometheus.metrics.secret.new.annotations:
|
||||
foo: bar
|
||||
prometheus.metrics.secret.new.labels:
|
||||
bar: foo
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- exists:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
foo: bar
|
||||
- exists:
|
||||
path: metadata.labels
|
||||
value:
|
||||
bar: foo
|
||||
- equal:
|
||||
path: metadata.name
|
||||
value: reposilite-unittest-basic-auth-credentials
|
||||
- equal:
|
||||
path: stringData.password
|
||||
value: foo
|
||||
- equal:
|
||||
path: stringData.username
|
||||
value: bar
|
||||
|
||||
- it: Skip rendering if existing secret is used
|
||||
set:
|
||||
prometheus.metrics.enabled: true
|
||||
prometheus.metrics.secret.existing.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
Reference in New Issue
Block a user