Skip to content

Commit

Permalink
feat(node-analyzer): Add unittest for runtime and host scanner custom…
Browse files Browse the repository at this point in the history
… probe fields
  • Loading branch information
FedericoFeresini committed Sep 13, 2024
1 parent 07e9150 commit 6c48754
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 2 deletions.
113 changes: 113 additions & 0 deletions charts/node-analyzer/tests/daemonset_probes_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
suite: Test Daemonset Abc
templates:
- templates/daemonset-node-analyzer.yaml
# For checksums
- templates/runtimeScanner/runtime-scanner-configmap.yaml
- templates/configmap-host-scanner.yaml
- clusterrole-node-analyzer.yaml
- clusterrolebinding-node-analyzer.yaml
- configmap-benchmark-runner.yaml
- configmap-host-analyzer.yaml
- configmap-image-analyzer.yaml
- secrets.yaml
- serviceaccount-node-analyzer.yaml
values:
- ./default_required_values.yaml
tests:
- it: assert default sysdig-runtime-scanner probes
set:
nodeAnalyzer:
runtimeScanner:
deploy: true
asserts:
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].livenessProbe.initialDelaySeconds
value: 90
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].livenessProbe.periodSeconds
value: 3
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].readinessProbe.initialDelaySeconds
value: 90
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].readinessProbe.periodSeconds
value: 3
templates:
- templates/daemonset-node-analyzer.yaml
- it: assert custom sysdig-runtime-scanner probess
set:
nodeAnalyzer:
runtimeScanner:
deploy: true
livenessProbe:
probe:
initialDelaySeconds: 10
periodSeconds: 5
readinessProbe:
probe:
initialDelaySeconds: 15
periodSeconds: 10
asserts:
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].livenessProbe.initialDelaySeconds
value: 10
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].livenessProbe.periodSeconds
value: 5
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].readinessProbe.initialDelaySeconds
value: 15
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].readinessProbe.periodSeconds
value: 10
templates:
- templates/daemonset-node-analyzer.yaml
- it: assert default sysdig-host-scanner probes
set:
nodeAnalyzer:
hostScanner:
deploy: true
asserts:
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].livenessProbe.initialDelaySeconds
value: 90
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].livenessProbe.periodSeconds
value: 3
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].readinessProbe.initialDelaySeconds
value: 90
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].readinessProbe.periodSeconds
value: 3
templates:
- templates/daemonset-node-analyzer.yaml
- it: assert custom sysdig-host-scanner probess
set:
nodeAnalyzer:
hostScanner:
deploy: true
livenessProbe:
probe:
initialDelaySeconds: 10
periodSeconds: 5
readinessProbe:
probe:
initialDelaySeconds: 15
periodSeconds: 10
asserts:
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].livenessProbe.initialDelaySeconds
value: 10
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].livenessProbe.periodSeconds
value: 5
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].readinessProbe.initialDelaySeconds
value: 15
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].readinessProbe.periodSeconds
value: 10
templates:
- templates/daemonset-node-analyzer.yaml

4 changes: 2 additions & 2 deletions 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.64.10
version: 1.65.0
maintainers:
- name: AlbertoBarba
email: [email protected]
Expand Down Expand Up @@ -36,7 +36,7 @@ dependencies:
- name: node-analyzer
# repository: https://charts.sysdig.com
repository: file://../node-analyzer
version: ~1.31.7
version: ~1.32.0
alias: nodeAnalyzer
condition: nodeAnalyzer.enabled
- name: cluster-scanner
Expand Down

0 comments on commit 6c48754

Please sign in to comment.