Skip to content

Commit

Permalink
fix(cluster-scanner): corrected incompatibility with helm 3.9 (#1383)
Browse files Browse the repository at this point in the history
  • Loading branch information
michele-mangili authored Sep 29, 2023
1 parent 013e7d3 commit 3fe6f6e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 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.6.0
version: 0.6.1

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.6.0 \
--create-namespace -n sysdig --version=0.6.1 \
--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.6.0 \
--create-namespace -n sysdig --version=0.6.1 \
--set global.clusterConfig.name=CLUSTER_NAME \
--set global.sysdig.region=SYSDIG_REGION \
--set global.sysdig.accessKey=YOUR-KEY-HERE
Expand Down Expand Up @@ -160,7 +160,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.6.0 \
--create-namespace -n sysdig --version=0.6.1 \
--set global.sysdig.region="us1"
```

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

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

Expand Down
14 changes: 7 additions & 7 deletions charts/cluster-scanner/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ Version tags must be semver2-compatible otherwise no check will be performed.
*/}}
{{- define "cluster-scanner.checkVersionCompatibility" -}}
{{- if regexMatch "^[0-9]+\\.[0-9]+\\.[0-9]+.*" .Tag -}}
{{- $version := semver .Tag -}}
{{- if and (hasKey (default .Values dict) "onPremCompatibilityVersion") (eq (semver .Values.onPremCompatibilityVersion | (semver "6.6.0").Compare) 1) -}}
{{- if ne ($version | (semver "0.5.0").Compare) 1 -}}
{{- $version := .Tag -}}
{{- if ( semverCompare "< 6.6.0" ( .Values.onPremCompatibilityVersion | default "6.6.0" )) -}}
{{- if not ( semverCompare "< 0.5.0" $version ) -}}
{{- fail (printf "incompatible version for %s, set %s expected < 0.5.0" .Component .Tag) -}}
{{- end -}}
{{- else -}}
{{- if eq ($version | (semver "0.5.0").Compare) 1 -}}
{{- if not ( semverCompare ">= 0.5.0" $version ) -}}
{{- fail (printf "incompatible version for %s, set %s expected >= 0.5.0" .Component .Tag) -}}
{{- end -}}
{{- end -}}
Expand All @@ -234,10 +234,10 @@ Version tags must be semver2-compatible otherwise no check will be performed.
Generates configmap data to enable platform services if onPremCompatibility version is not set, or it is greater than 6.6.0
*/}}
{{- define "cluster-scanner.enablePlatformServicesConfig" -}}
{{- if not ( and (hasKey (default .Values dict) "onPremCompatibilityVersion") (eq (semver .Values.onPremCompatibilityVersion | (semver "6.6.0").Compare) 1)) -}}
{{- if ( semverCompare ">= 6.6.0" (.Values.onPremCompatibilityVersion | default "6.6.0" )) -}}
enable_platform_services: "true"
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}

{{/*
Return the proper image name for the Runtime Status Integrator
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.23.7
version: 1.23.8
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.6.0
version: ~0.6.1
alias: clusterScanner
condition: clusterScanner.enabled
- name: kspm-collector
Expand Down

0 comments on commit 3fe6f6e

Please sign in to comment.