Skip to content

Commit

Permalink
Adds in conditional to check if locust lib configmap is required or not
Browse files Browse the repository at this point in the history
  • Loading branch information
byronmansfield committed Nov 21, 2024
1 parent 154d82b commit ee3764b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stable/locust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ helm install my-release oci://ghcr.io/deliveryhero/helm-charts/locust -f values.
| loadtest.headless | bool | `false` | whether to run locust with headless settings |
| loadtest.locustCmd | string | `"/opt/venv/bin/locust"` | The command to run Locust |
| loadtest.locust_host | string | `"https://www.google.com"` | the host you will load test |
| loadtest.locust_lib_configmap | string | `"example-lib"` | name of a configmap containing your lib (default uses the example lib) |
| loadtest.locust_lib_configmap | string | `""` | name of a configmap containing your lib (default uses the example lib) |
| loadtest.locust_locustfile | string | `"main.py"` | the name of the locustfile |
| loadtest.locust_locustfile_configmap | string | `"example-locustfile"` | name of a configmap containing your locustfile (default uses the example locustfile) |
| loadtest.locust_locustfile_path | string | `"/mnt/locust"` | the path of the locustfile (without trailing backslash) |
Expand Down
2 changes: 2 additions & 0 deletions stable/locust/templates/configmap-locust-lib.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.loadtest.locust_lib_configmap }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -6,3 +7,4 @@ metadata:
{{ include "locust.labels" . | indent 4 }}
data:
{{ ($.Files.Glob (printf "locustfiles/%s/lib/*" .Values.loadtest.name)).AsConfig | indent 2 }}
{{- end }}
2 changes: 1 addition & 1 deletion stable/locust/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ loadtest:
# loadtest.locust_locustfile_configmap -- name of a configmap containing your locustfile (default uses the example locustfile)
locust_locustfile_configmap: "example-locustfile"
# loadtest.locust_lib_configmap -- name of a configmap containing your lib (default uses the example lib)
locust_lib_configmap: "example-lib"
locust_lib_configmap: ""
# loadtest.locust_host -- the host you will load test
locust_host: https://www.google.com
# loadtest.pip_packages -- a list of extra python pip packages to install
Expand Down

0 comments on commit ee3764b

Please sign in to comment.