Skip to content

Commit 9b3864f

Browse files
fix(cluster-scanner): removed unneeded version compatibility checks (#1404)
1 parent f6cabe9 commit 9b3864f

File tree

6 files changed

+33
-246
lines changed

6 files changed

+33
-246
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.1
7+
version: 0.7.2
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.1 \
28+
--create-namespace -n sysdig --version=0.7.2 \
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.1 \
58+
--create-namespace -n sysdig --version=0.7.2 \
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.1 \
164+
--create-namespace -n sysdig --version=0.7.2 \
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.1 \
173+
--create-namespace -n sysdig --version=0.7.2 \
174174
--values values.yaml
175175
```
176176

charts/cluster-scanner/templates/_helpers.tpl

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -205,31 +205,6 @@ Define the proper imageRegistry to use for imageSbomExtractor
205205
{{- end -}}
206206
{{- end -}}
207207

208-
{{/*
209-
Cluster scanner version compatibility check.
210-
211-
If .Values.onPremCompatibilityVersion is set to a version below 6.6.0, it checks whether
212-
the provided tag is < 0.5.0 .
213-
214-
Otherwise, it checks if the provided tag is >= 0.5.0 .
215-
216-
Version tags must be semver2-compatible otherwise no check will be performed.
217-
*/}}
218-
{{- define "cluster-scanner.checkVersionCompatibility" -}}
219-
{{- if regexMatch "^[0-9]+\\.[0-9]+\\.[0-9]+.*" .Tag -}}
220-
{{- $version := .Tag -}}
221-
{{- if ( semverCompare "< 6.6.0" ( .Values.onPremCompatibilityVersion | default "6.6.0" )) -}}
222-
{{- if not ( semverCompare "< 0.5.0" $version ) -}}
223-
{{- fail (printf "incompatible version for %s, set %s expected < 0.5.0" .Component .Tag) -}}
224-
{{- end -}}
225-
{{- else -}}
226-
{{- if not ( semverCompare ">= 0.5.0" $version ) -}}
227-
{{- fail (printf "incompatible version for %s, set %s expected >= 0.5.0" .Component .Tag) -}}
228-
{{- end -}}
229-
{{- end -}}
230-
{{- end -}}
231-
{{- end -}}
232-
233208
{{/*
234209
Generates configmap data to enable platform services if onPremCompatibility version is not set, or it is greater than 6.6.0
235210
*/}}
@@ -244,7 +219,6 @@ Return the proper image name for the Runtime Status Integrator
244219
*/}}
245220
{{- define "cluster-scanner.runtimeStatusIntegrator.image" -}}
246221
{{- $data := dict "Values" .Values "Tag" .Values.runtimeStatusIntegrator.image.tag "Component" "runtimeStatusIntegrator.image.tag" -}}
247-
{{- include "cluster-scanner.checkVersionCompatibility" $data -}}
248222
{{- include "cluster-scanner.runtimeStatusIntegrator.imageRegistry" . -}} / {{- .Values.runtimeStatusIntegrator.image.repository -}} : {{- .Values.runtimeStatusIntegrator.image.tag -}}
249223
{{- end -}}
250224

@@ -254,7 +228,6 @@ Return the proper image name for the Image Sbom Extractor
254228
{{- define "cluster-scanner.imageSbomExtractor.image" -}}
255229
{{- $data := dict "Values" .Values "Tag" .Values.imageSbomExtractor.image.tag -}}
256230
{{- $data := dict "Values" .Values "Tag" .Values.imageSbomExtractor.image.tag "Component" "imageSbomExtractor.image.tag" -}}
257-
{{- include "cluster-scanner.checkVersionCompatibility" $data -}}
258231
{{- include "cluster-scanner.imageSbomExtractor.imageRegistry" . -}} / {{- .Values.imageSbomExtractor.image.repository -}} : {{- .Values.imageSbomExtractor.image.tag -}}
259232
{{- end -}}
260233

charts/cluster-scanner/tests/configmap_test.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,14 @@ tests:
358358
- isNull:
359359
path: data.enable_platform_services
360360

361+
- it: "has correct platform services value when onPremCompatibilityVersion is = 6.5"
362+
set:
363+
global.sysdig.apiHost: "http://test.com"
364+
onPremCompatibilityVersion: "6.5"
365+
asserts:
366+
- isNull:
367+
path: data.enable_platform_services
368+
361369
- it: "has correct platform services value when onPremCompatibilityVersion is = 6.6.0"
362370
set:
363371
global.sysdig.apiHost: "http://test.com"
@@ -367,6 +375,15 @@ tests:
367375
path: data.enable_platform_services
368376
value: "true"
369377

378+
- it: "has correct platform services value when onPremCompatibilityVersion is just a major.minor version"
379+
set:
380+
global.sysdig.apiHost: "http://test.com"
381+
onPremCompatibilityVersion: "6.6"
382+
asserts:
383+
- equal:
384+
path: data.enable_platform_services
385+
value: "true"
386+
370387
- it: "has correct platform services value when onPremCompatibilityVersion is > 6.6.0"
371388
set:
372389
global.sysdig.apiHost: "http://test.com"
@@ -375,3 +392,12 @@ tests:
375392
- equal:
376393
path: data.enable_platform_services
377394
value: "true"
395+
396+
397+
- it: "fails if onPremCompatibilityVersion is not a valid semver"
398+
set:
399+
global.sysdig.apiHost: "http://test.com"
400+
onPremCompatibilityVersion: "gigimarzullo"
401+
asserts:
402+
- failedTemplate:
403+
errorMessage: "Invalid Semantic Version"

charts/cluster-scanner/tests/deployment_test.yaml

Lines changed: 0 additions & 212 deletions
Original file line numberDiff line numberDiff line change
@@ -181,218 +181,6 @@ tests:
181181
name: test-release-cluster-scanner
182182
optional: true
183183

184-
- it: "fails if the onPremCompatibilityVersion is not set and the runtimeStatusIntegrator version is incorrect"
185-
templates:
186-
- ../templates/deployment.yaml
187-
set:
188-
runtimeStatusIntegrator.image.tag: "0.3.4"
189-
imageSbomExtractor.image.tag: "1.3.4"
190-
asserts:
191-
- failedTemplate:
192-
errorMessage: "incompatible version for runtimeStatusIntegrator.image.tag, set 0.3.4 expected >= 0.5.0"
193-
194-
- it: "fails if the onPremCompatibilityVersion is not set and the imageSbomExtractor version is incorrect"
195-
templates:
196-
- ../templates/deployment.yaml
197-
set:
198-
runtimeStatusIntegrator.image.tag: "1.3.4"
199-
imageSbomExtractor.image.tag: "0.1.0"
200-
asserts:
201-
- failedTemplate:
202-
errorMessage: "incompatible version for imageSbomExtractor.image.tag, set 0.1.0 expected >= 0.5.0"
203-
204-
- it: "fails if the onPremCompatibilityVersion is set to 6.2 and the runtimeStatusIntegrator version is incorrect"
205-
templates:
206-
- ../templates/deployment.yaml
207-
set:
208-
onPremCompatibilityVersion: "6.2"
209-
runtimeStatusIntegrator.image.tag: "4.3.4"
210-
imageSbomExtractor.image.tag: "0.3.4"
211-
asserts:
212-
- failedTemplate:
213-
errorMessage: "incompatible version for runtimeStatusIntegrator.image.tag, set 4.3.4 expected < 0.5.0"
214-
215-
- it: "fails if the onPremCompatibilityVersion is set to 6.2 and the imageSbomExtractor version is incorrect"
216-
templates:
217-
- ../templates/deployment.yaml
218-
set:
219-
onPremCompatibilityVersion: "6.2"
220-
runtimeStatusIntegrator.image.tag: "0.0.1"
221-
imageSbomExtractor.image.tag: "6.1.0"
222-
asserts:
223-
- failedTemplate:
224-
errorMessage: "incompatible version for imageSbomExtractor.image.tag, set 6.1.0 expected < 0.5.0"
225-
226-
- it: "fails if the onPremCompatibilityVersion is set to 6.3 and the runtimeStatusIntegrator version is incorrect"
227-
templates:
228-
- ../templates/deployment.yaml
229-
set:
230-
onPremCompatibilityVersion: "6.3"
231-
runtimeStatusIntegrator.image.tag: "4.3.4"
232-
imageSbomExtractor.image.tag: "0.3.4"
233-
asserts:
234-
- failedTemplate:
235-
errorMessage: "incompatible version for runtimeStatusIntegrator.image.tag, set 4.3.4 expected < 0.5.0"
236-
237-
- it: "fails if the onPremCompatibilityVersion is set to 6.3 and the imageSbomExtractor version is incorrect"
238-
templates:
239-
- ../templates/deployment.yaml
240-
set:
241-
onPremCompatibilityVersion: "6.3"
242-
runtimeStatusIntegrator.image.tag: "0.0.1"
243-
imageSbomExtractor.image.tag: "6.1.0"
244-
asserts:
245-
- failedTemplate:
246-
errorMessage: "incompatible version for imageSbomExtractor.image.tag, set 6.1.0 expected < 0.5.0"
247-
248-
- it: "fails if the onPremCompatibilityVersion is set to 6.6 and the runtimeStatusIntegrator version is incorrect"
249-
templates:
250-
- ../templates/deployment.yaml
251-
set:
252-
onPremCompatibilityVersion: "6.6"
253-
runtimeStatusIntegrator.image.tag: "0.3.4"
254-
imageSbomExtractor.image.tag: "1.3.4"
255-
asserts:
256-
- failedTemplate:
257-
errorMessage: "incompatible version for runtimeStatusIntegrator.image.tag, set 0.3.4 expected >= 0.5.0"
258-
259-
- it: "fails if the onPremCompatibilityVersion is set to 6.6 and the imageSbomExtractor version is incorrect"
260-
templates:
261-
- ../templates/deployment.yaml
262-
set:
263-
onPremCompatibilityVersion: "6.6"
264-
runtimeStatusIntegrator.image.tag: "1.3.4"
265-
imageSbomExtractor.image.tag: "0.1.0"
266-
asserts:
267-
- failedTemplate:
268-
errorMessage: "incompatible version for imageSbomExtractor.image.tag, set 0.1.0 expected >= 0.5.0"
269-
270-
- it: "fails if the onPremCompatibilityVersion is set to 6.7 and the runtimeStatusIntegrator version is incorrect"
271-
templates:
272-
- ../templates/deployment.yaml
273-
set:
274-
onPremCompatibilityVersion: "6.7"
275-
runtimeStatusIntegrator.image.tag: "0.3.4"
276-
imageSbomExtractor.image.tag: "1.3.4"
277-
asserts:
278-
- failedTemplate:
279-
errorMessage: "incompatible version for runtimeStatusIntegrator.image.tag, set 0.3.4 expected >= 0.5.0"
280-
281-
- it: "fails if the onPremCompatibilityVersion is set to 6.7 and the imageSbomExtractor version is incorrect"
282-
templates:
283-
- ../templates/deployment.yaml
284-
set:
285-
onPremCompatibilityVersion: "6.7"
286-
runtimeStatusIntegrator.image.tag: "1.3.4"
287-
imageSbomExtractor.image.tag: "0.1.0"
288-
asserts:
289-
- failedTemplate:
290-
errorMessage: "incompatible version for imageSbomExtractor.image.tag, set 0.1.0 expected >= 0.5.0"
291-
292-
- it: "succeeds if the onPremCompatibilityVersion is not set and the runtimeStatusIntegrator and imageSbomExtractor versions are correct"
293-
templates:
294-
- ../templates/deployment.yaml
295-
set:
296-
runtimeStatusIntegrator.image.tag: "2.3.4"
297-
imageSbomExtractor.image.tag: "0.5.0"
298-
asserts:
299-
- equal:
300-
path: spec.template.spec.containers[0].image
301-
value: quay.io/sysdig/runtime-status-integrator:2.3.4
302-
- equal:
303-
path: spec.template.spec.containers[1].image
304-
value: quay.io/sysdig/image-sbom-extractor:0.5.0
305-
306-
- it: "succeeds if the onPremCompatibilityVersion is set to 6.2 and the runtimeStatusIntegrator and imageSbomExtractor versions are correct"
307-
templates:
308-
- ../templates/deployment.yaml
309-
set:
310-
onPremCompatibilityVersion: "6.2"
311-
runtimeStatusIntegrator.image.tag: "0.3.4"
312-
imageSbomExtractor.image.tag: "0.4.10"
313-
asserts:
314-
- equal:
315-
path: spec.template.spec.containers[0].image
316-
value: quay.io/sysdig/runtime-status-integrator:0.3.4
317-
- equal:
318-
path: spec.template.spec.containers[1].image
319-
value: quay.io/sysdig/image-sbom-extractor:0.4.10
320-
321-
- it: "succeeds if the onPremCompatibilityVersion is set to 6.3 and the runtimeStatusIntegrator and imageSbomExtractor versions are correct"
322-
templates:
323-
- ../templates/deployment.yaml
324-
set:
325-
onPremCompatibilityVersion: "6.3"
326-
runtimeStatusIntegrator.image.tag: "0.3.4"
327-
imageSbomExtractor.image.tag: "0.4.10"
328-
asserts:
329-
- equal:
330-
path: spec.template.spec.containers[0].image
331-
value: quay.io/sysdig/runtime-status-integrator:0.3.4
332-
- equal:
333-
path: spec.template.spec.containers[1].image
334-
value: quay.io/sysdig/image-sbom-extractor:0.4.10
335-
336-
- it: "succeeds if the onPremCompatibilityVersion is set to 6.6 and the runtimeStatusIntegrator and imageSbomExtractor versions are correct"
337-
templates:
338-
- ../templates/deployment.yaml
339-
set:
340-
onPremCompatibilityVersion: "6.6"
341-
runtimeStatusIntegrator.image.tag: "2.3.4"
342-
imageSbomExtractor.image.tag: "0.5.0"
343-
asserts:
344-
- equal:
345-
path: spec.template.spec.containers[0].image
346-
value: quay.io/sysdig/runtime-status-integrator:2.3.4
347-
- equal:
348-
path: spec.template.spec.containers[1].image
349-
value: quay.io/sysdig/image-sbom-extractor:0.5.0
350-
351-
- it: "succeeds if the onPremCompatibilityVersion is set to 6.7 and the runtimeStatusIntegrator and imageSbomExtractor versions are correct"
352-
templates:
353-
- ../templates/deployment.yaml
354-
set:
355-
onPremCompatibilityVersion: "6.7"
356-
runtimeStatusIntegrator.image.tag: "2.3.4"
357-
imageSbomExtractor.image.tag: "0.5.0"
358-
asserts:
359-
- equal:
360-
path: spec.template.spec.containers[0].image
361-
value: quay.io/sysdig/runtime-status-integrator:2.3.4
362-
- equal:
363-
path: spec.template.spec.containers[1].image
364-
value: quay.io/sysdig/image-sbom-extractor:0.5.0
365-
366-
- it: "succeeds if the runtimeStatusIntegrator version is not a semver and the onPremCompatibilityVersion is 6.4"
367-
templates:
368-
- ../templates/deployment.yaml
369-
set:
370-
onPremCompatibilityVersion: "6.4"
371-
runtimeStatusIntegrator.image.tag: "unstable-rc"
372-
imageSbomExtractor.image.tag: "0.4.9"
373-
asserts:
374-
- equal:
375-
path: spec.template.spec.containers[0].image
376-
value: quay.io/sysdig/runtime-status-integrator:unstable-rc
377-
- equal:
378-
path: spec.template.spec.containers[1].image
379-
value: quay.io/sysdig/image-sbom-extractor:0.4.9
380-
381-
- it: "succeeds if the imageSbomExtractor version is not a semver and the onPremCompatibilityVersion is 6.6"
382-
templates:
383-
- ../templates/deployment.yaml
384-
set:
385-
onPremCompatibilityVersion: "6.6"
386-
runtimeStatusIntegrator.image.tag: "1.3.5"
387-
imageSbomExtractor.image.tag: "3bc59a4958d15dfa6afed20dfd2459e268b4cda8"
388-
asserts:
389-
- equal:
390-
path: spec.template.spec.containers[0].image
391-
value: quay.io/sysdig/runtime-status-integrator:1.3.5
392-
- equal:
393-
path: spec.template.spec.containers[1].image
394-
value: quay.io/sysdig/image-sbom-extractor:3bc59a4958d15dfa6afed20dfd2459e268b4cda8
395-
396184
- it: "correctly sets the CLUSTERSCANNER_PLATFORM_ENABLED env var"
397185
templates:
398186
- ../templates/deployment.yaml

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.24.4
5+
version: 1.24.5
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.1
45+
version: ~0.7.2
4646
alias: clusterScanner
4747
condition: clusterScanner.enabled
4848
- name: kspm-collector

0 commit comments

Comments
 (0)