Skip to content

Commit

Permalink
Merge pull request #49 from konateq/44-mappings-responses
Browse files Browse the repository at this point in the history
Support definition of mappings and responses in the values.yaml file
  • Loading branch information
gitkent authored Sep 26, 2024
2 parents e4f0a15 + d823f7b commit eb2b411
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/wiremock/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.2.0
version: 1.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
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 eb2b411

Please sign in to comment.