Skip to content

Commit 41c2fb4

Browse files
committed
Support definition of mappings and responses in the values.yaml file
1 parent 0082150 commit 41c2fb4

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

Diff for: charts/wiremock/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.1.0
18+
version: 1.2.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

Diff for: charts/wiremock/templates/configmap-mappings.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ data:
1010
{{- if hasPrefix "mappings/" $key }} {{/* only when in mappings/ */}}
1111
{{ $key | trimPrefix "mappings/" }}: {{ $files.Get $key | quote }} {{/* adapt $key as desired */}}
1212
{{- end }}
13-
{{- end }}
13+
{{- end }}
14+
{{- with .Values.mappings }}
15+
{{- toYaml . | nindent 2 }}
16+
{{- end }}

Diff for: charts/wiremock/templates/configmap-responses.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ data:
1010
{{- if hasPrefix "responses/" $key }} {{/* only when in responses/ */}}
1111
{{ $key | trimPrefix "responses/" }}: {{ $files.Get $key | quote }} {{/* adapt $key as desired */}}
1212
{{- end }}
13+
{{- end }}
14+
{{- with .Values.responses }}
15+
{{- toYaml . | nindent 2 }}
1316
{{- end }}

Diff for: charts/wiremock/values.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
44

5+
mappings: {}
6+
# custom_mapping.json: |
7+
# {
8+
# "request": {
9+
# "method": "POST",
10+
# "url": "/v1/custom-mapping"
11+
# },
12+
# "response":{
13+
# "status":200,
14+
# "bodyFileName":"responses/custom_response.json",
15+
# "headers":{
16+
# "Content-Type":"application/json"
17+
# }
18+
# }
19+
# }
20+
21+
responses: {}
22+
# custom_response.json: |
23+
# {
24+
# "message": "Here is my custom response!"
25+
# }
26+
527
replicaCount: 1
628

729
image:

0 commit comments

Comments
 (0)