diff --git a/.gitignore b/.gitignore index 50603230a..be31a5d65 100644 --- a/.gitignore +++ b/.gitignore @@ -145,3 +145,6 @@ Chart.lock *.envrc .vscode .local + +# ASDF config +.tool-versions diff --git a/charts/sysdig-deploy/Chart.yaml b/charts/sysdig-deploy/Chart.yaml index cbdee52a1..b17854395 100644 --- a/charts/sysdig-deploy/Chart.yaml +++ b/charts/sysdig-deploy/Chart.yaml @@ -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: alberto.barba@sysdig.com diff --git a/charts/sysdig-deploy/templates/cluster-scanner-runtime-scanner-check.yaml b/charts/sysdig-deploy/templates/cluster-scanner-runtime-scanner-check.yaml index 0803fba59..4cebc145d 100644 --- a/charts/sysdig-deploy/templates/cluster-scanner-runtime-scanner-check.yaml +++ b/charts/sysdig-deploy/templates/cluster-scanner-runtime-scanner-check.yaml @@ -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 -}} diff --git a/charts/sysdig-deploy/tests/scannerconstraint_test.yaml b/charts/sysdig-deploy/tests/scannerconstraint_test.yaml index 74c86b72d..fd61d094e 100644 --- a/charts/sysdig-deploy/tests/scannerconstraint_test.yaml +++ b/charts/sysdig-deploy/tests/scannerconstraint_test.yaml @@ -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: