diff --git a/charts/agent/Chart.yaml b/charts/agent/Chart.yaml index cb6749a63..5b1c238ed 100644 --- a/charts/agent/Chart.yaml +++ b/charts/agent/Chart.yaml @@ -5,7 +5,7 @@ description: Sysdig Monitor and Secure agent type: application # currently matching sysdig 1.14.32 -version: 1.13.0 +version: 1.13.1 appVersion: 12.15.0 diff --git a/charts/agent/templates/configmap-deployment.yaml b/charts/agent/templates/configmap-deployment.yaml index 51b4cbf07..dda0090dc 100644 --- a/charts/agent/templates/configmap-deployment.yaml +++ b/charts/agent/templates/configmap-deployment.yaml @@ -51,8 +51,8 @@ data: {{- $baseSettings := .Values.sysdig.settings -}} {{- $caFilePath := printf "%s%s" "/etc/ca-certs/" (include "sysdig.custom_ca.keyName" (dict "global" .Values.global.ssl "component" .Values.ssl)) }} {{- $mergedSettings := mergeOverwrite $baseSettings (dict "http_proxy" (dict "ca_certificate" $caFilePath)) -}} - {{ toYaml $mergedSettings | indent 4 }} + {{ toYaml $mergedSettings | nindent 4 }} {{- else if .Values.sysdig.settings }} - {{ toYaml .Values.sysdig.settings | indent 4 }} + {{ toYaml .Values.sysdig.settings | nindent 4 }} {{- end }} {{- end }} diff --git a/charts/agent/templates/configmap.yaml b/charts/agent/templates/configmap.yaml index 9947d63df..d02d13ccd 100644 --- a/charts/agent/templates/configmap.yaml +++ b/charts/agent/templates/configmap.yaml @@ -34,9 +34,9 @@ data: {{- $baseSettings := .Values.sysdig.settings -}} {{- $caFilePath := printf "%s%s" "/etc/ca-certs/" (include "sysdig.custom_ca.keyName" (dict "global" .Values.global.ssl "component" .Values.ssl)) }} {{- $mergedSettings := mergeOverwrite $baseSettings (dict "http_proxy" (dict "ca_certificate" $caFilePath)) -}} - {{ toYaml $mergedSettings | indent 4 }} + {{ toYaml $mergedSettings | nindent 4 }} {{- else if .Values.sysdig.settings }} - {{ toYaml .Values.sysdig.settings | indent 4 }} + {{ toYaml .Values.sysdig.settings | nindent 4 }} {{- end }} {{- if .Values.leaderelection.enable }} k8s_delegation_election: true diff --git a/charts/agent/tests/custom_settings_test.yaml b/charts/agent/tests/custom_settings_test.yaml new file mode 100644 index 000000000..a909f8933 --- /dev/null +++ b/charts/agent/tests/custom_settings_test.yaml @@ -0,0 +1,100 @@ +suite: Testing pre-generated values and best-known edge cases +templates: + - configmap.yaml + - configmap-deployment.yaml +tests: + - it: Testing custom settings + set: + sysdig: + accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE + settings: + first: + value: 1 + second: example + asserts: + - matchRegex: + path: data['dragent.yaml'] + pattern: |- + .* + first: + value: 1 + second: example + .* + template: configmap.yaml + + - it: Testing custom settings when custom CA is in place + set: + ssl: + ca: + certs: + - | + -----BEGIN CERTIFICATE----- + my-test-cert + -----END CERTIFICATE----- + keyName: "root_ca.crt" + sysdig: + accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE + settings: + first: + value: 1 + second: example + asserts: + - matchRegex: + path: data['dragent.yaml'] + pattern: |- + .* + first: + value: 1 + second: example + .* + template: configmap.yaml + + - it: Testing custom settings in deployment + set: + delegatedAgentDeployment: + enabled: true + sysdig: + accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE + settings: + first: + value: 1 + second: example + asserts: + - matchRegex: + path: data['dragent.yaml'] + pattern: |- + .* + first: + value: 1 + second: example + .* + template: configmap-deployment.yaml + + - it: Testing custom settings in deployment when custom CA is in place + set: + delegatedAgentDeployment: + enabled: true + ssl: + ca: + certs: + - | + -----BEGIN CERTIFICATE----- + my-test-cert + -----END CERTIFICATE----- + keyName: "root_ca.crt" + sysdig: + accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE + settings: + first: + value: 1 + second: example + asserts: + - matchRegex: + path: data['dragent.yaml'] + pattern: |- + .* + first: + value: 1 + second: example + .* + template: configmap-deployment.yaml