Skip to content

Commit 16386ec

Browse files
authored
fix: feat(node-analyzer,cluster-scanner): resolving bug with nodeAnalyzer and clusterScanner condition. (#1479)
1 parent cdae3a7 commit 16386ec

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,6 @@ Chart.lock
145145
*.envrc
146146
.vscode
147147
.local
148+
149+
# ASDF config
150+
.tool-versions

charts/sysdig-deploy/Chart.yaml

Lines changed: 1 addition & 1 deletion
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.29.9
5+
version: 1.29.10
66
maintainers:
77
- name: AlbertoBarba
88
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1-
{{- if and .Values.clusterScanner.enabled .Values.nodeAnalyzer.enabled .Values.nodeAnalyzer.nodeAnalyzer.runtimeScanner.deploy ( include "deployRuntimeScanner" . ) -}}
1+
{{- $nodeAnalyzerEnabled := default false .Values.nodeAnalyzer.enabled -}}
2+
{{- $runtimeScannerDeploy := false -}}
3+
4+
{{- if $nodeAnalyzerEnabled -}}
5+
{{- if and (default dict .Values.nodeAnalyzer).nodeAnalyzer (default dict .Values.nodeAnalyzer.nodeAnalyzer).runtimeScanner -}}
6+
{{- $runtimeScannerDeploy = default false .Values.nodeAnalyzer.nodeAnalyzer.runtimeScanner.deploy -}}
7+
{{- end -}}
8+
{{- end -}}
9+
10+
{{- if and $nodeAnalyzerEnabled $runtimeScannerDeploy .Values.clusterScanner.enabled -}}
211
{{ fail "Cannot enable both the Runtime Scanner and the Cluster Scanner at the same time" }}
312
{{- end -}}

charts/sysdig-deploy/tests/scannerconstraint_test.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,27 @@ tests:
5050
- hasDocuments:
5151
count: 0
5252

53+
- it: Should not fail if node analyzer is entirely disabled and nested nodeAnalyzer object is not set
54+
set:
55+
nodeAnalyzer:
56+
enabled: false
57+
clusterScanner:
58+
enabled: true
59+
asserts:
60+
- hasDocuments:
61+
count: 0
62+
63+
- it: Should not fail if node analyzer is entirely disabled and nested nodeAnalyzer.runtimeScanner object is not set
64+
set:
65+
nodeAnalyzer:
66+
enabled: false
67+
nodeAnalyzer:
68+
clusterScanner:
69+
enabled: true
70+
asserts:
71+
- hasDocuments:
72+
count: 0
73+
5374
- it: Should not fail if runtime scanner is disabled
5475
set:
5576
nodeAnalyzer:

0 commit comments

Comments
 (0)