File tree Expand file tree Collapse file tree 4 files changed +76
-8
lines changed Expand file tree Collapse file tree 4 files changed +76
-8
lines changed Original file line number Diff line number Diff line change 58
58
" ca_cert_file" (printf " %s%s" (include " cluster.tls_certificates.mount_path" .) (include " cluster.tls_certificates.ca_cert_file_name" .))
59
59
) -} }
60
60
{ {- if (include " cluster.audit_enabled" .) -} }
61
- { {- 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.on_prem_version | default " " ) -} }
61
+ { {- if ( include " common.semver.is_valid " (.Values.on_prem_version | default " " ) ) -} }
62
62
{ {- if semverCompare " < 6.12.0" .Values.on_prem_version -} }
63
63
{ {- if not (include " common.credentials.has_secure_api_token" . ) -} }
64
64
{ {- fail " Secure API Token is required for kubernetes audit with On Premise Versions < 6.12.0" -} }
81
81
{ {- $_ := set $clusterScannerConfig " leader_election_lock_name" (include " cluster.container_vulnerability_management_lease_name" .) -} }
82
82
{ {- $_ := set $config " cluster_scanner" $clusterScannerConfig -} }
83
83
84
- { {- 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.on_prem_version | default " " ) -} }
84
+ { {- if ( include " common.semver.is_valid " (.Values.on_prem_version | default " " ) ) -} }
85
85
{ {- if semverCompare " < 6.12.0" .Values.on_prem_version -} }
86
86
{ {- $_ := set $config .features.container_vulnerability_management " platform_services_enabled" false -} }
87
87
{ {- end -} }
Original file line number Diff line number Diff line change
1
+ { {- define " common.semver.is_valid" -} }
2
+ { {- 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\\ -]+)*))?$" . -} }
3
+ { {- true -} }
4
+ { {- end -} }
5
+ { {- end -} }
Original file line number Diff line number Diff line change 41
41
{{- $_ := set $sysdigEndpointConfig $k $v -}}
42
42
{{- end -}}
43
43
{{- end -}}
44
- {{- if (include "common.is_alt_region" .) -}}
45
- {{- $_ := set $sysdigEndpointConfig "region" "custom" -}}
46
- {{- $_ := set $sysdigEndpointConfig "api_url" (printf "https://%s" (include "common.secure_api_endpoint" .)) -}}
47
- {{- $_ := set $sysdigEndpointConfig.collector "host" (include "common.collector_endpoint" .) -}}
48
- {{- $_ := set $sysdigEndpointConfig.collector "port" 6443 -}}
44
+ {{- if (include "common.semver.is_valid" (.Values.host_windows.image.tag | default "")) -}}
45
+ {{- if semverCompare "<= 0.7.1" .Values.host_windows.image.tag -}}
46
+ {{- if (include "common.is_alt_region" .) -}}
47
+ {{- $_ := set $sysdigEndpointConfig "region" "custom" -}}
48
+ {{- $_ := set $sysdigEndpointConfig "api_url" (printf "https://%s" (include "common.secure_api_endpoint" .)) -}}
49
+ {{- $_ := set $sysdigEndpointConfig.collector "host" (include "common.collector_endpoint" .) -}}
50
+ {{- $_ := set $sysdigEndpointConfig.collector "port" 6443 -}}
51
+ {{- end -}}
52
+ {{- end -}}
49
53
{{- end -}}
50
54
{{- $_ := set $config "sysdig_endpoint" $sysdigEndpointConfig -}}
51
55
Original file line number Diff line number Diff line change @@ -331,7 +331,7 @@ tests:
331
331
proxy:
332
332
no_proxy: example.com
333
333
334
- - it : Alternative regions
334
+ - it : Alternative regions (default)
335
335
set :
336
336
sysdig_endpoint :
337
337
region : " eu1-alt"
@@ -356,3 +356,62 @@ tests:
356
356
host: ingest-alt-eu1.app.sysdig.com
357
357
port: 6443
358
358
region: custom
359
+
360
+ - it : Alternative regions (host-shield windows version <= 0.7.1)
361
+ set :
362
+ sysdig_endpoint :
363
+ region : " eu1-alt"
364
+ host_windows :
365
+ image :
366
+ tag : " 0.7.1"
367
+ asserts :
368
+ - hasDocuments :
369
+ count : 1
370
+ - containsDocument :
371
+ kind : ConfigMap
372
+ apiVersion : v1
373
+ name : release-name-shield-host-windows
374
+ - equal :
375
+ path : metadata.namespace
376
+ value : shield-namespace
377
+ - exists :
378
+ path : data["host-shield.yaml"]
379
+ - matchRegex :
380
+ path : data["host-shield.yaml"]
381
+ pattern : |
382
+ sysdig_endpoint:
383
+ api_url: https://eu1.app.sysdig.com
384
+ collector:
385
+ host: ingest-alt-eu1.app.sysdig.com
386
+ port: 6443
387
+ region: custom
388
+
389
+ - it : Alternative regions (host-shield windows version > 0.7.1)
390
+ set :
391
+ sysdig_endpoint :
392
+ region : " eu1-alt"
393
+ api_url :
394
+ collector :
395
+ host :
396
+ port :
397
+ host_windows :
398
+ image :
399
+ tag : " 0.7.2"
400
+ asserts :
401
+ - hasDocuments :
402
+ count : 1
403
+ - containsDocument :
404
+ kind : ConfigMap
405
+ apiVersion : v1
406
+ name : release-name-shield-host-windows
407
+ - equal :
408
+ path : metadata.namespace
409
+ value : shield-namespace
410
+ - exists :
411
+ path : data["host-shield.yaml"]
412
+ - matchRegex :
413
+ path : data["host-shield.yaml"]
414
+ pattern : |
415
+ sysdig_endpoint:
416
+ collector: {}
417
+ region: eu1-alt
You can’t perform that action at this time.
0 commit comments