Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: feat(node-analyzer,cluster-scanner): resolving bug with nodeAnalyzer and clusterScanner condition. #1479

Merged
merged 8 commits into from
Nov 16, 2023
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
Loading