Skip to content

Commit

Permalink
check only when onPremCompatibilityVersion is not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoFeresini committed Oct 18, 2023
1 parent bedfbe3 commit 9bf52e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions charts/cluster-scanner/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,12 @@ Define the proper imageRegistry to use for imageSbomExtractor

{{/*
Generates configmap data to enable platform services if onPremCompatibility version is not set, or it is greater than 6.6.0
It also makes sure that the plarform services are enabled in regions which support them.
It also makes sure that the plarform 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" )) -}}
{{- $regionsPlatformEnabled := dict "us1" "" "us2" "" "us3" "" "au1" "" "eu1" -}}
{{- if hasKey $regionsPlatformEnabled .Values.global.sysdig.region -}}
enable_platform_services: "true"
{{- if and ( semverCompare ">= 6.6.0" (.Values.onPremCompatibilityVersion | default "6.6.0" )) -}}
{{- if or (hasKey (dict "us1" "" "us2" "" "us3" "" "au1" "" "eu1") .Values.global.sysdig.region) .Values.onPremCompatibilityVersion -}}
enable_platform_services: "true"
{{- end -}}
{{- end -}}
{{- end -}}
Expand Down
3 changes: 2 additions & 1 deletion charts/cluster-scanner/tests/configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,9 @@ tests:
onPremCompatibilityVersion: "6.6.0"
global.sysdig.region: ""
asserts:
- isNull:
- 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"
set:
Expand Down

0 comments on commit 9bf52e4

Please sign in to comment.