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
2 changes: 1 addition & 1 deletion charts/agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ sources:
- https://app.sysdigcloud.com/#/settings/user
- https://github.com/draios/sysdig
type: application
version: 1.17.1
version: 1.17.2
8 changes: 8 additions & 0 deletions charts/agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -511,3 +511,11 @@ true
{{- define "agent.localForwarderConfigMapName" }}
{{- include "agent.configmapName" . | trunc 46 | trimSuffix "-" | printf "%s-local-forwarder" }}
{{- end }}

{{- define "agent.enableHttpProbes" }}
{{- if regexMatch "^v?([0-9]+)(\\.[0-9]+)?(\\.[0-9]+)?(-([0-9A-Za-z\\-]+(\\.[0-9A-Za-z\\-]+)*))?(\\+([0-9A-Za-z\\-]+(\\.[0-9A-Za-z\\-]+)*))?$" .Values.image.tag }}
{{- if semverCompare ">= 12.18.0-0" .Values.image.tag }}
{{- printf "true" -}}
{{- end }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/agent/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ spec:
value: /opt/draios/etc/ca-certs/{{- include "sysdig.custom_ca.keyName" (dict "global" .Values.global.ssl "component" .Values.ssl) -}}
{{- end }}
readinessProbe:
{{- if ge (semver "12.18.0" | (semver .Values.image.tag).Compare) 0 }}
{{- if eq (include "agent.enableHttpProbes" .) "true" }}
httpGet:
path: /healthz

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A totally unrelated comment, is the z at the end on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's a sort of convention

port: 24483
Expand Down
2 changes: 1 addition & 1 deletion charts/agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ spec:
value: /opt/draios/etc/ca-certs/{{- include "sysdig.custom_ca.keyName" (dict "global" .Values.global.ssl "component" .Values.ssl) -}}
{{- end }}
readinessProbe:
{{- if ge (semver "12.18.0" | (semver .Values.image.tag).Compare) 0 }}
{{- if eq (include "agent.enableHttpProbes" .) "true" }}
httpGet:
path: /healthz
port: 24483
Expand Down
66 changes: 66 additions & 0 deletions charts/agent/tests/readiness_probe_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,38 @@ tests:
initialDelaySeconds: 90
periodSeconds: 3
template: templates/daemonset.yaml
- it: "[DaemonSet] Readiness Probe (agent == dev)"
set:
image:
tag: dev
asserts:
- equal:
path: spec.template.spec.containers[0].readinessProbe
value:
exec:
command:
- test
- -e
- /opt/draios/logs/running
initialDelaySeconds: 90
periodSeconds: 3
template: templates/daemonset.yaml
- it: "[DaemonSet] Readiness Probe (agent == latest)"
set:
image:
tag: latest
asserts:
- equal:
path: spec.template.spec.containers[0].readinessProbe
value:
exec:
command:
- test
- -e
- /opt/draios/logs/running
initialDelaySeconds: 90
periodSeconds: 3
template: templates/daemonset.yaml
- it: "[DelegatedAgentDeployment] Readiness Probe (agent > 12.18.0)"
set:
delegatedAgentDeployment:
Expand Down Expand Up @@ -94,6 +126,40 @@ tests:
- /opt/draios/logs/running
initialDelaySeconds: 90
periodSeconds: 3
- it: "[DelegatedAgentDeployment] Readiness Probe (agent == dev)"
set:
delegatedAgentDeployment:
enabled: true
image:
tag: dev
asserts:
- equal:
path: spec.template.spec.containers[0].readinessProbe
value:
exec:
command:
- test
- -e
- /opt/draios/logs/running
initialDelaySeconds: 90
periodSeconds: 3
- it: "[DelegatedAgentDeployment] Readiness Probe (agent == latest)"
set:
delegatedAgentDeployment:
enabled: true
image:
tag: latest
asserts:
- equal:
path: spec.template.spec.containers[0].readinessProbe
value:
exec:
command:
- test
- -e
- /opt/draios/logs/running
initialDelaySeconds: 90
periodSeconds: 3
- it: Test setting probe delays
set:
daemonset:
Expand Down