mirror of
https://github.com/truenas/charts.git
synced 2024-04-21 15:21:45 +00:00
93 lines
1.9 KiB
YAML
93 lines
1.9 KiB
YAML
suite: configmap data test
|
|
templates:
|
|
- common.yaml
|
|
tests:
|
|
- it: should pass with key-value data
|
|
set:
|
|
configmaps:
|
|
my-configmap1:
|
|
enabled: true
|
|
data:
|
|
foo: bar
|
|
asserts:
|
|
- documentIndex: &configmapDoc 0
|
|
isKind:
|
|
of: ConfigMap
|
|
- documentIndex: *configmapDoc
|
|
equal:
|
|
path: data
|
|
value:
|
|
foo: bar
|
|
|
|
- it: should pass with key-value data from tpl
|
|
set:
|
|
data: bar
|
|
configmaps:
|
|
my-configmap1:
|
|
enabled: true
|
|
data:
|
|
foo: "{{ .Values.data }}"
|
|
asserts:
|
|
- documentIndex: *configmapDoc
|
|
equal:
|
|
path: data
|
|
value:
|
|
foo: bar
|
|
|
|
- it: should pass with scalar data
|
|
set:
|
|
configmaps:
|
|
my-configmap1:
|
|
enabled: true
|
|
data:
|
|
foo: |
|
|
some multi line
|
|
string text
|
|
asserts:
|
|
- documentIndex: *configmapDoc
|
|
equal:
|
|
path: data
|
|
value:
|
|
foo: |
|
|
some multi line
|
|
string text
|
|
|
|
- it: should pass with scalar data with tpl
|
|
set:
|
|
data: Some other text
|
|
configmaps:
|
|
my-configmap:
|
|
enabled: true
|
|
data:
|
|
foo: |
|
|
file start
|
|
{{ .Values.data }}
|
|
asserts:
|
|
- documentIndex: *configmapDoc
|
|
equal:
|
|
path: data
|
|
value:
|
|
foo: |
|
|
file start
|
|
Some other text
|
|
|
|
- it: should pass with scalar data from tpl
|
|
set:
|
|
data: |
|
|
Some other text
|
|
some_text
|
|
configmaps:
|
|
my-configmap1:
|
|
enabled: true
|
|
data:
|
|
foo: |
|
|
{{- .Values.data | nindent 2 }}
|
|
asserts:
|
|
- documentIndex: *configmapDoc
|
|
equal:
|
|
path: data
|
|
value:
|
|
foo: |
|
|
Some other text
|
|
some_text
|