Skip to content

Commit

Permalink
fix: feat(node-analyzer,cluster-scanner): resolving bug with nodeAnal…
Browse files Browse the repository at this point in the history
…yzer and clusterScanner condition. (#1479)
  • Loading branch information
IgorEulalio authored Nov 16, 2023
1 parent cdae3a7 commit 16386ec
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,6 @@ Chart.lock
*.envrc
.vscode
.local

# ASDF config
.tool-versions
2 changes: 1 addition & 1 deletion 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.9
version: 1.29.10
maintainers:
- name: AlbertoBarba
email: [email protected]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{{- if and .Values.clusterScanner.enabled .Values.nodeAnalyzer.enabled .Values.nodeAnalyzer.nodeAnalyzer.runtimeScanner.deploy ( include "deployRuntimeScanner" . ) -}}
{{- $nodeAnalyzerEnabled := default false .Values.nodeAnalyzer.enabled -}}
{{- $runtimeScannerDeploy := false -}}

{{- if $nodeAnalyzerEnabled -}}
{{- if and (default dict .Values.nodeAnalyzer).nodeAnalyzer (default dict .Values.nodeAnalyzer.nodeAnalyzer).runtimeScanner -}}
{{- $runtimeScannerDeploy = default false .Values.nodeAnalyzer.nodeAnalyzer.runtimeScanner.deploy -}}
{{- end -}}
{{- end -}}

{{- if and $nodeAnalyzerEnabled $runtimeScannerDeploy .Values.clusterScanner.enabled -}}
{{ fail "Cannot enable both the Runtime Scanner and the Cluster Scanner at the same time" }}
{{- end -}}
21 changes: 21 additions & 0 deletions charts/sysdig-deploy/tests/scannerconstraint_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,27 @@ tests:
- hasDocuments:
count: 0

- it: Should not fail if node analyzer is entirely disabled and nested nodeAnalyzer object is not set
set:
nodeAnalyzer:
enabled: false
clusterScanner:
enabled: true
asserts:
- hasDocuments:
count: 0

- it: Should not fail if node analyzer is entirely disabled and nested nodeAnalyzer.runtimeScanner object is not set
set:
nodeAnalyzer:
enabled: false
nodeAnalyzer:
clusterScanner:
enabled: true
asserts:
- hasDocuments:
count: 0

- it: Should not fail if runtime scanner is disabled
set:
nodeAnalyzer:
Expand Down

0 comments on commit 16386ec

Please sign in to comment.