Skip to content

Commit

Permalink
fix(cluster-scanner): corrected onPremCompatibilityVersion to 7.0.0 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
michele-mangili authored Nov 10, 2023
1 parent 5acd9d0 commit 09c0c71
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion charts/cluster-scanner/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Sysdig Cluster Scanner

type: application

version: 0.8.2
version: 0.8.3

appVersion: "0.1.0"
home: https://www.sysdig.com/
Expand Down
8 changes: 4 additions & 4 deletions charts/cluster-scanner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $ pre-commit run -a
$ helm repo add sysdig https://charts.sysdig.com
$ helm repo update
$ helm upgrade --install sysdig-cluster-scanner sysdig/cluster-scanner \
--create-namespace -n sysdig --version=0.8.2 \
--create-namespace -n sysdig --version=0.8.3 \
--set global.clusterConfig.name=CLUSTER_NAME \
--set global.sysdig.region=SYSDIG_REGION \
--set global.sysdig.accessKey=YOUR-KEY-HERE
Expand Down Expand Up @@ -55,7 +55,7 @@ To install the chart with the release name `cluster-scanner`, run:

```console
$ helm upgrade --install sysdig-cluster-scanner sysdig/cluster-scanner \
--create-namespace -n sysdig --version=0.8.2 \
--create-namespace -n sysdig --version=0.8.3 \
--set global.clusterConfig.name=CLUSTER_NAME \
--set global.sysdig.region=SYSDIG_REGION \
--set global.sysdig.accessKey=YOUR-KEY-HERE
Expand Down Expand Up @@ -161,7 +161,7 @@ Specify each parameter using the **`--set key=value[,key=value]`** argument to `

```console
$ helm upgrade --install sysdig-cluster-scanner sysdig/cluster-scanner \
--create-namespace -n sysdig --version=0.8.2 \
--create-namespace -n sysdig --version=0.8.3 \
--set global.sysdig.region="us1"
```

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

```console
$ helm upgrade --install sysdig-cluster-scanner sysdig/cluster-scanner \
--create-namespace -n sysdig --version=0.8.2 \
--create-namespace -n sysdig --version=0.8.3 \
--values values.yaml
```

Expand Down
4 changes: 2 additions & 2 deletions charts/cluster-scanner/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ Define the proper imageRegistry to use for imageSbomExtractor
{{- end -}}

{{/*
Generates configmap data to enable platform services if onPremCompatibility version is not set, or it is greater than 6.6.0
Generates configmap data to enable platform services if onPremCompatibility version is not set, or it is greater than 7.0.0
It also makes sure that the platform services are enabled in regions which support them when onPremCompatibility is not defined.
*/}}
{{- define "cluster-scanner.enablePlatformServicesConfig" -}}
{{- if ( semverCompare ">= 6.6.0" (.Values.onPremCompatibilityVersion | default "6.6.0" )) -}}
{{- if ( semverCompare ">= 7.0.0" (.Values.onPremCompatibilityVersion | default "7.0.0" )) -}}
{{- $regionsPlatformEnabled := list "us1" "us2" "us3" "us4" "au1" "eu1" -}}
{{- if or (has .Values.global.sysdig.region $regionsPlatformEnabled) .Values.onPremCompatibilityVersion -}}
enable_platform_services: "true"
Expand Down
18 changes: 9 additions & 9 deletions charts/cluster-scanner/tests/configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ tests:
path: data.enable_platform_services
value: "true"

- it: "has correct platform services value when onPremCompatibilityVersion is < 6.6 and region does NOT support platform services"
- it: "has correct platform services value when onPremCompatibilityVersion is < 7.0 and region does NOT support platform services"
set:
global.sysdig.apiHost: "http://test.com"
onPremCompatibilityVersion: "6.5.99"
Expand All @@ -368,7 +368,7 @@ tests:
- isNull:
path: data.enable_platform_services

- it: "has correct platform services value when onPremCompatibilityVersion is < 6.6 and region supports platform services"
- it: "has correct platform services value when onPremCompatibilityVersion is < 7.0 and region supports platform services"
set:
global.sysdig.apiHost: "http://test.com"
onPremCompatibilityVersion: "6.5.99"
Expand All @@ -395,20 +395,20 @@ tests:
- isNull:
path: data.enable_platform_services

- it: "has correct platform services value when onPremCompatibilityVersion is = 6.6.0 and region does NOT support platform services"
- it: "has correct platform services value when onPremCompatibilityVersion is = 7.0.0 and region does NOT support platform services"
set:
global.sysdig.apiHost: "http://test.com"
onPremCompatibilityVersion: "6.6.0"
onPremCompatibilityVersion: "7.0.0"
global.sysdig.region: ""
asserts:
- equal:
path: data.enable_platform_services
value: "true"

- it: "has correct platform services value when onPremCompatibilityVersion is = 6.6.0 and region supports platform services"
- it: "has correct platform services value when onPremCompatibilityVersion is = 7.0.0 and region supports platform services"
set:
global.sysdig.apiHost: "http://test.com"
onPremCompatibilityVersion: "6.6.0"
onPremCompatibilityVersion: "7.0.0"
global.sysdig.region: "us1"
asserts:
- equal:
Expand All @@ -418,16 +418,16 @@ tests:
- it: "has correct platform services value when onPremCompatibilityVersion is just a major.minor version"
set:
global.sysdig.apiHost: "http://test.com"
onPremCompatibilityVersion: "6.6"
onPremCompatibilityVersion: "7.0"
asserts:
- equal:
path: data.enable_platform_services
value: "true"

- it: "has correct platform services value when onPremCompatibilityVersion is > 6.6.0"
- it: "has correct platform services value when onPremCompatibilityVersion is > 7.0.0"
set:
global.sysdig.apiHost: "http://test.com"
onPremCompatibilityVersion: "6.6.1"
onPremCompatibilityVersion: "7.0.1"
asserts:
- equal:
path: data.enable_platform_services
Expand Down
4 changes: 2 additions & 2 deletions charts/sysdig-deploy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: sysdig-deploy
description: A chart with various Sysdig components for Kubernetes
type: application
version: 1.29.5
version: 1.29.6
maintainers:
- name: AlbertoBarba
email: [email protected]
Expand Down Expand Up @@ -42,7 +42,7 @@ dependencies:
- name: cluster-scanner
# repository: https://charts.sysdig.com
repository: file://../cluster-scanner
version: ~0.8.2
version: ~0.8.3
alias: clusterScanner
condition: clusterScanner.enabled
- name: kspm-collector
Expand Down

0 comments on commit 09c0c71

Please sign in to comment.