Skip to content

Commit c8b0cde

Browse files
chore(shield): add ssl config mapping for windows host-shield (#2286)
1 parent 265d29f commit c8b0cde

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-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
1515
type: application
16-
version: 1.8.2
16+
version: 1.8.3
1717
appVersion: "1.0.0"

charts/shield/templates/host/_windows_configmap_helpers.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@
6565
{{- end -}}
6666
{{- $_ := set $config "cluster_config" $clusterConfig -}}
6767
68+
{{- $sslConfig := dict "verify" .Values.ssl.verify -}}
69+
{{- if (include "common.custom_ca.enabled" .) }}
70+
{{- $path := (include "common.custom_ca.path" (merge (dict) . (dict "CACertsPath" "certificates/"))) }}
71+
{{- $_ := set $sslConfig "ca" (dict "cert_path" $path) }}
72+
{{- end -}}
73+
74+
{{- $_ := set $config "ssl" $sslConfig -}}
75+
6876
{{- $config := merge $config (dict "proxy" (include "host.proxy_config" . | fromYaml)) }}
6977
7078
{{- if and (include "common.semver.is_valid" .Values.host_windows.image.tag) (semverCompare ">= 0.8.0" .Values.host_windows.image.tag) }}

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,3 +437,22 @@ tests:
437437
additional_settings:
438438
connection_timeout: 1000
439439
k8s_cluster_name: test-cluster
440+
441+
- it: Test ssl custom ca settings
442+
set:
443+
ssl:
444+
verify: true
445+
ca:
446+
certs:
447+
- "-----BEGIN CERTIFICATE-----\nMIID...==\n-----END CERTIFICATE-----"
448+
key_name: "rootCA.crt"
449+
asserts:
450+
- notExists:
451+
path: data['dragent.yaml']
452+
- matchRegex:
453+
path: data['host-shield.yaml']
454+
pattern: |
455+
ssl:
456+
ca:
457+
cert_path: certificates/rootCA.crt
458+
verify: true

0 commit comments

Comments
 (0)