Skip to content

Commit

Permalink
Support definition of mappings and responses in the values.yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
subigre committed Sep 24, 2024
1 parent e4f0a15 commit eb48ff1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
5 changes: 4 additions & 1 deletion charts/wiremock/templates/configmap-mappings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ data:
{{- if hasPrefix "mappings/" $key }} {{/* only when in mappings/ */}}
{{ $key | trimPrefix "mappings/" }}: {{ $files.Get $key | quote }} {{/* adapt $key as desired */}}
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.mappings }}
{{- toYaml . | nindent 2 }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/wiremock/templates/configmap-responses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ data:
{{- if hasPrefix "responses/" $key }} {{/* only when in responses/ */}}
{{ $key | trimPrefix "responses/" }}: {{ $files.Get $key | quote }} {{/* adapt $key as desired */}}
{{- end }}
{{- end }}
{{- with .Values.responses }}
{{- toYaml . | nindent 2 }}
{{- end }}
22 changes: 22 additions & 0 deletions charts/wiremock/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

mappings: {}
# custom_mapping.json: |
# {
# "request": {
# "method": "POST",
# "url": "/v1/custom-mapping"
# },
# "response":{
# "status":200,
# "bodyFileName":"responses/custom_response.json",
# "headers":{
# "Content-Type":"application/json"
# }
# }
# }

responses: {}
# custom_response.json: |
# {
# "message": "Here is my custom response!"
# }

replicaCount: 1

image:
Expand Down

0 comments on commit eb48ff1

Please sign in to comment.