Skip to content

Commit 3fed7ff

Browse files
chore(shield): handle on windows host the agent additional_settings inside host-shield.yaml config (#2249)
1 parent 0032e03 commit 3fed7ff

File tree

5 files changed

+39
-1
lines changed

5 files changed

+39
-1
lines changed

charts/shield/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ maintainers:
1313
- name: mavimo
1414
email: marcovito.moscaritolo@sysdig.com
1515
type: application
16-
version: 1.6.0
16+
version: 1.6.1
1717
appVersion: "1.0.0"

charts/shield/templates/host/_windows_configmap_helpers.tpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@
6767
6868
{{- $config := merge $config (dict "proxy" (include "host.proxy_config" . | fromYaml)) }}
6969
70+
{{- if and (include "common.semver.is_valid" .Values.host_windows.image.tag) (semverCompare ">= 0.8.0" .Values.host_windows.image.tag) }}
71+
{{- $runtimeAdditionalSettings := (include "host.windows.runtime_config_override" .) | fromYaml }}
72+
{{- $config := merge $config (dict "internals" (dict "agent_runtime" (dict "additional_settings" $runtimeAdditionalSettings))) }}
73+
{{- end }}
74+
7075
{{- $override := (include "host.windows.shield_config_override" .) | fromYaml }}
7176
{{- $finalConfig := mergeOverwrite $config $override }}
7277
{{- $finalConfig | toYaml }}

charts/shield/templates/host/configmap-windows.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ metadata:
99
data:
1010
host-shield.yaml: |
1111
{{- include "host.windows.host_shield_config" . | nindent 4 }}
12+
{{- if and (include "common.semver.is_valid" .Values.host_windows.image.tag) (semverCompare "< 0.8.0" .Values.host_windows.image.tag) }}
1213
dragent.yaml: |
1314
{{- include "host.windows.configmap" . | nindent 4 }}
1415
{{- end }}
16+
{{- end }}

charts/shield/tests/host/configmap-windows-dragent-yaml_test.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,3 +729,16 @@ tests:
729729
pattern: |
730730
collector: ingest-alt-eu1.app.sysdig.com
731731
collector_port: 6443
732+
733+
- it: Test agent_runtime_additional_settings with version < 0.8.0
734+
set:
735+
host_windows:
736+
image:
737+
tag: "0.7.1"
738+
agent_runtime_additional_settings:
739+
connection_timeout: 1000
740+
asserts:
741+
- matchRegex:
742+
path: data['dragent.yaml']
743+
pattern: |
744+
connection_timeout: 1000

charts/shield/tests/host/configmap-windows-host-shield-config_test.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,3 +415,21 @@ tests:
415415
sysdig_endpoint:
416416
collector: {}
417417
region: eu1-alt
418+
419+
- it: Test agent_runtime_additional_settings with version >= 0.8.0
420+
set:
421+
host_windows:
422+
image:
423+
tag: "0.8.0"
424+
agent_runtime_additional_settings:
425+
connection_timeout: 1000
426+
asserts:
427+
- notExists:
428+
path: data['dragent.yaml']
429+
- matchRegex:
430+
path: data['host-shield.yaml']
431+
pattern: |
432+
internals:
433+
agent_runtime:
434+
additional_settings:
435+
connection_timeout: 1000

0 commit comments

Comments
 (0)