Skip to content

Commit 23b421c

Browse files
feat(cluster-scanner): Enable platform services only in regions which support them (#1413)
1 parent 64bd12b commit 23b421c

File tree

5 files changed

+55
-12
lines changed

5 files changed

+55
-12
lines changed

charts/cluster-scanner/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Sysdig Cluster Scanner
44

55
type: application
66

7-
version: 0.7.2
7+
version: 0.8.0
88

99
appVersion: "0.1.0"
1010
home: https://www.sysdig.com/

charts/cluster-scanner/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $ pre-commit run -a
2525
$ helm repo add sysdig https://charts.sysdig.com
2626
$ helm repo update
2727
$ helm upgrade --install sysdig-cluster-scanner sysdig/cluster-scanner \
28-
--create-namespace -n sysdig --version=0.7.2 \
28+
--create-namespace -n sysdig --version=0.8.0 \
2929
--set global.clusterConfig.name=CLUSTER_NAME \
3030
--set global.sysdig.region=SYSDIG_REGION \
3131
--set global.sysdig.accessKey=YOUR-KEY-HERE
@@ -55,7 +55,7 @@ To install the chart with the release name `cluster-scanner`, run:
5555

5656
```console
5757
$ helm upgrade --install sysdig-cluster-scanner sysdig/cluster-scanner \
58-
--create-namespace -n sysdig --version=0.7.2 \
58+
--create-namespace -n sysdig --version=0.8.0 \
5959
--set global.clusterConfig.name=CLUSTER_NAME \
6060
--set global.sysdig.region=SYSDIG_REGION \
6161
--set global.sysdig.accessKey=YOUR-KEY-HERE
@@ -161,7 +161,7 @@ Specify each parameter using the **`--set key=value[,key=value]`** argument to `
161161

162162
```console
163163
$ helm upgrade --install sysdig-cluster-scanner sysdig/cluster-scanner \
164-
--create-namespace -n sysdig --version=0.7.2 \
164+
--create-namespace -n sysdig --version=0.8.0 \
165165
--set global.sysdig.region="us1"
166166
```
167167

@@ -170,7 +170,7 @@ installing the chart. For example:
170170

171171
```console
172172
$ helm upgrade --install sysdig-cluster-scanner sysdig/cluster-scanner \
173-
--create-namespace -n sysdig --version=0.7.2 \
173+
--create-namespace -n sysdig --version=0.8.0 \
174174
--values values.yaml
175175
```
176176

charts/cluster-scanner/templates/_helpers.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,14 @@ Define the proper imageRegistry to use for imageSbomExtractor
207207

208208
{{/*
209209
Generates configmap data to enable platform services if onPremCompatibility version is not set, or it is greater than 6.6.0
210+
It also makes sure that the platform services are enabled in regions which support them when onPremCompatibility is not defined.
210211
*/}}
211212
{{- define "cluster-scanner.enablePlatformServicesConfig" -}}
212213
{{- if ( semverCompare ">= 6.6.0" (.Values.onPremCompatibilityVersion | default "6.6.0" )) -}}
214+
{{- $regionsPlatformEnabled := list "us1" "us2" "us3" "au1" "eu1" -}}
215+
{{- if or (has .Values.global.sysdig.region $regionsPlatformEnabled) .Values.onPremCompatibilityVersion -}}
213216
enable_platform_services: "true"
217+
{{- end -}}
214218
{{- end -}}
215219
{{- end -}}
216220

charts/cluster-scanner/tests/configmap_test.yaml

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,34 +342,74 @@ tests:
342342
path: data.no_proxy
343343
value: "fake-no-proxy"
344344

345-
- it: "has correct platform services value when onPremCompatibilityVersion is NOT provided"
345+
- it: "has correct platform services value when onPremCompatibilityVersion is NOT provided and region does NOT support platform services"
346346
set:
347347
global.sysdig.apiHost: "http://test.com"
348+
global.sysdig.region: ""
349+
asserts:
350+
- isNull:
351+
path: data.enable_platform_services
352+
353+
- it: "has correct platform services value when onPremCompatibilityVersion is NOT provided and region supports platform services"
354+
set:
355+
global.sysdig.apiHost: "http://test.com"
356+
global.sysdig.region: "us1"
348357
asserts:
349358
- equal:
350359
path: data.enable_platform_services
351360
value: "true"
352361

353-
- it: "has correct platform services value when onPremCompatibilityVersion is < 6.6"
362+
- it: "has correct platform services value when onPremCompatibilityVersion is < 6.6 and region does NOT support platform services"
354363
set:
355364
global.sysdig.apiHost: "http://test.com"
356365
onPremCompatibilityVersion: "6.5.99"
366+
global.sysdig.region: ""
357367
asserts:
358368
- isNull:
359369
path: data.enable_platform_services
360370

361-
- it: "has correct platform services value when onPremCompatibilityVersion is = 6.5"
371+
- it: "has correct platform services value when onPremCompatibilityVersion is < 6.6 and region supports platform services"
372+
set:
373+
global.sysdig.apiHost: "http://test.com"
374+
onPremCompatibilityVersion: "6.5.99"
375+
global.sysdig.region: "us1"
376+
asserts:
377+
- isNull:
378+
path: data.enable_platform_services
379+
380+
- it: "has correct platform services value when onPremCompatibilityVersion is = 6.5 and region does NOT support platform services"
362381
set:
363382
global.sysdig.apiHost: "http://test.com"
364383
onPremCompatibilityVersion: "6.5"
384+
global.sysdig.region: ""
365385
asserts:
366386
- isNull:
367387
path: data.enable_platform_services
368388

369-
- it: "has correct platform services value when onPremCompatibilityVersion is = 6.6.0"
389+
- it: "has correct platform services value when onPremCompatibilityVersion is = 6.5 and region supports platform services"
390+
set:
391+
global.sysdig.apiHost: "http://test.com"
392+
onPremCompatibilityVersion: "6.5"
393+
global.sysdig.region: "us1"
394+
asserts:
395+
- isNull:
396+
path: data.enable_platform_services
397+
398+
- it: "has correct platform services value when onPremCompatibilityVersion is = 6.6.0 and region does NOT support platform services"
399+
set:
400+
global.sysdig.apiHost: "http://test.com"
401+
onPremCompatibilityVersion: "6.6.0"
402+
global.sysdig.region: ""
403+
asserts:
404+
- equal:
405+
path: data.enable_platform_services
406+
value: "true"
407+
408+
- it: "has correct platform services value when onPremCompatibilityVersion is = 6.6.0 and region supports platform services"
370409
set:
371410
global.sysdig.apiHost: "http://test.com"
372411
onPremCompatibilityVersion: "6.6.0"
412+
global.sysdig.region: "us1"
373413
asserts:
374414
- equal:
375415
path: data.enable_platform_services
@@ -393,7 +433,6 @@ tests:
393433
path: data.enable_platform_services
394434
value: "true"
395435

396-
397436
- it: "fails if onPremCompatibilityVersion is not a valid semver"
398437
set:
399438
global.sysdig.apiHost: "http://test.com"

charts/sysdig-deploy/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: sysdig-deploy
33
description: A chart with various Sysdig components for Kubernetes
44
type: application
5-
version: 1.25.0
5+
version: 1.26.0
66
maintainers:
77
- name: AlbertoBarba
88
@@ -42,7 +42,7 @@ dependencies:
4242
- name: cluster-scanner
4343
# repository: https://charts.sysdig.com
4444
repository: file://../cluster-scanner
45-
version: ~0.7.2
45+
version: ~0.8.0
4646
alias: clusterScanner
4747
condition: clusterScanner.enabled
4848
- name: kspm-collector

0 commit comments

Comments
 (0)