You've already forked prometheus-postgres-exporter
Initial Commit
This commit is contained in:
79
unittests/serviceAccounts/serviceAccount.yaml
Normal file
79
unittests/serviceAccounts/serviceAccount.yaml
Normal file
@ -0,0 +1,79 @@
|
||||
chart:
|
||||
appVersion: 0.1.0
|
||||
version: 0.1.0
|
||||
suite: ServiceAccount prometheus-postgres-exporter template (basic)
|
||||
release:
|
||||
name: prometheus-postgres-exporter-unittest
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/prometheus-postgres-exporter/serviceAccount.yaml
|
||||
tests:
|
||||
- it: Skip rendering.
|
||||
set:
|
||||
serviceAccount.existing.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: Rendering serviceAccount with default values.
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- containsDocument:
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
name: prometheus-postgres-exporter-unittest
|
||||
namespace: testing
|
||||
- notExists:
|
||||
path: metadata.annotations
|
||||
- notExists:
|
||||
path: metadata.labels
|
||||
- equal:
|
||||
path: spec.automountServiceAccountToken
|
||||
value: true
|
||||
- notExists:
|
||||
path: spec.imagePullSecrets
|
||||
- notExists:
|
||||
path: spec.secrets
|
||||
|
||||
|
||||
- it: Rendering serviceAccount with custom values.
|
||||
set:
|
||||
serviceAccount.new.annotations:
|
||||
foo: bar
|
||||
serviceAccount.new.labels:
|
||||
bar: foo
|
||||
serviceAccount.new.automountServiceAccountToken: false
|
||||
serviceAccount.new.imagePullSecrets:
|
||||
- name: "my-pull-secret"
|
||||
serviceAccount.new.secrets:
|
||||
- name: "my-secret"
|
||||
namespace: "my-namespace"
|
||||
fieldPath: "my-path"
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- exists:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
foo: bar
|
||||
- exists:
|
||||
path: metadata.labels
|
||||
value:
|
||||
bar: foo
|
||||
- equal:
|
||||
path: metadata.name
|
||||
value: prometheus-postgres-exporter-unittest
|
||||
- equal:
|
||||
path: spec.automountServiceAccountToken
|
||||
value: false
|
||||
- equal:
|
||||
path: spec.imagePullSecrets
|
||||
value:
|
||||
- name: "my-pull-secret"
|
||||
- equal:
|
||||
path: spec.secrets
|
||||
value:
|
||||
- name: "my-secret"
|
||||
namespace: "my-namespace"
|
||||
fieldPath: "my-path"
|
Reference in New Issue
Block a user