Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tall-trams-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"helm-charts": minor
---

Supports passing additional arguments to the check-alerts task. This allows setting the concurrency and sourceTimeoutMs through helm.
2 changes: 1 addition & 1 deletion .github/workflows/chart-test-legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

- name: Run Helm unit tests
run: |
helm plugin install https://github.com/helm-unittest/helm-unittest.git || true
helm plugin install https://github.com/helm-unittest/helm-unittest.git --version v1.0.3 ${{ runner.debug && '--debug' || ''}} || true
helm unittest charts/hdx-oss-v2

- name: Deploy hdx-oss-v2 chart
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/chart-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

- name: Run Helm unit tests
run: |
helm plugin install https://github.com/helm-unittest/helm-unittest.git || true
helm plugin install https://github.com/helm-unittest/helm-unittest.git --version v1.0.3 ${{ runner.debug && '--debug' || ''}} || true
helm unittest charts/clickstack

- name: Deploy ClickStack chart
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-test-legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Install helm-unittest plugin
run: |
helm plugin install https://github.com/helm-unittest/helm-unittest.git
helm plugin install https://github.com/helm-unittest/helm-unittest.git --version v1.0.2 ${{ runner.debug && '--debug' || ''}}

- name: Run helm-unittest
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Install helm-unittest plugin
run: |
helm plugin install https://github.com/helm-unittest/helm-unittest.git
helm plugin install https://github.com/helm-unittest/helm-unittest.git --version v1.0.3 ${{ runner.debug && '--debug' || ''}}

- name: Run helm-unittest
run: |
Expand Down
18 changes: 16 additions & 2 deletions charts/clickstack/templates/cronjobs/task-checkAlerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,23 @@ spec:
imagePullPolicy: {{ .Values.hyperdx.image.pullPolicy }}
{{- $tag := .Values.hyperdx.image.tag | default .Chart.AppVersion -}}
{{- if and (regexMatch "^[0-9]+\\.[0-9]+\\.[0-9]+" $tag) (semverCompare "< 2.7.0" $tag) }} # before esbuild revert
command: ["node", "/app/packages/api/tasks/index", "check-alerts"]
command:
- "node"
- "/app/packages/api/tasks/index"
- "check-alerts"
{{- range $key, $value := .Values.tasks.checkAlerts.additionalArgs }}
- "--{{ $key }}"
- "{{ $value }}"
{{- end }}
{{- else }}
command: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"] # after esbuild revert
command: # after esbuild revert
- "node"
- "/app/packages/api/build/tasks/index.js"
- "check-alerts"
{{- range $key, $value := .Values.tasks.checkAlerts.additionalArgs }}
- "--{{ $key }}"
- "{{ $value }}"
{{- end }}
{{- end }}
envFrom:
- configMapRef:
Expand Down
60 changes: 60 additions & 0 deletions charts/clickstack/tests/task-checkAlerts_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,63 @@ tests:
- equal:
path: spec.jobTemplate.spec.template.spec.containers[0].command
value: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"]

- it: should not include additionalArgs when empty
set:
tasks:
enabled: true
checkAlerts:
additionalArgs: {}
hyperdx:
image:
tag: "2.8.0"
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.containers[0].command
value: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"]

- it: should include additionalArgs with -- prefix in command
set:
tasks:
enabled: true
checkAlerts:
additionalArgs:
concurrency: 6
sourceTimeoutMs: 90000
hyperdx:
image:
tag: "2.8.0"
asserts:
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "--concurrency"
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "6"
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "--sourceTimeoutMs"
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "90000"

- it: should include additionalArgs in pre-esbuild command path
set:
tasks:
enabled: true
checkAlerts:
additionalArgs:
concurrency: 4
hyperdx:
image:
tag: "2.6.0"
asserts:
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "/app/packages/api/tasks/index"
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "--concurrency"
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "4"
11 changes: 11 additions & 0 deletions charts/clickstack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,17 @@ tasks:
enabled: false
checkAlerts:
schedule: "*/1 * * * *" # Runs every 1 minute

additionalArgs:
{}
# Additional command line arguments can be supplied to the check-alerts
# task by defining the param as a key/value pair. These are passed to the
# task without validation in the helm chart.
#
# Examples:
# concurrency: 6
# sourceTimeoutMs: 90000

resources:
limits:
cpu: 200m
Expand Down