Skip to content

Commit

Permalink
fix(shield): apply kspm_analyzer agent app name (#1999)
Browse files Browse the repository at this point in the history
Co-authored-by: Alberto Barba <alberto.barba@sysdig.com>
  • Loading branch information
aroberts87 and AlbertoBarba authored Oct 29, 2024
1 parent dcddbf0 commit a08bf37
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/shield/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ maintainers:
- name: mavimo
email: marcovito.moscaritolo@sysdig.com
type: application
version: 0.1.10
version: 0.1.11
appVersion: "1.0.0"
3 changes: 3 additions & 0 deletions charts/shield/templates/host/_configmap_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
{{- $config = merge $config (dict "host_scanner" (dict "host_fs_mount_path" "/host")) }}
{{- end }}
{{- end }}
{{- if or .Values.features.posture.host_posture.enabled (dig "kspm_analyzer" "enabled" false .Values.host.additional_settings) }}
{{- $config = merge $config (dict "kspm_analyzer" (dict "agent_app_name" (include "shield.name" .))) }}
{{- end }}
{{- if .Values.cluster_config.tags -}}
{{- $tagList := list }}
{{- range $k, $v := .Values.cluster_config.tags }}
Expand Down
34 changes: 34 additions & 0 deletions charts/shield/tests/host/configmap-dragent-yaml_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -886,3 +886,37 @@ tests:
path: data['dragent.yaml']
pattern: |
tags: AgentTag3:AgentTagValue3,agentTag1:agentTagValue1,agentTag2:agentTagValue2
- it: Enabling Host Posture sets the agent app version setting
set:
features:
posture:
host_posture:
enabled: true
asserts:
- matchRegex:
path: data['dragent.yaml']
pattern: |
kspm_analyzer:
agent_app_name: shield
- it: Enabling Host Posture via additional_settings sets the agent app version setting
set:
host:
additional_settings:
kspm_analyzer :
enabled: true
asserts:
- matchRegex:
path: data['dragent.yaml']
pattern: |
kspm_analyzer:
agent_app_name: shield
- it: The agent_app_setting field is not present if host posture is not enabled
asserts:
- notMatchRegex:
path: data['dragent.yaml']
pattern: |
kspm_analyzer:
agent_app_name: shield

0 comments on commit a08bf37

Please sign in to comment.