Skip to content

Commit

Permalink
SSPROD-27133: fix failing node-analyzer chart tests and add tests to …
Browse files Browse the repository at this point in the history
…ensure hostPID is set correctly
  • Loading branch information
zohar-arad committed Jul 27, 2023
1 parent a370f71 commit 3799843
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/node-analyzer/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ true
{{- define "nodeAnalyzer.useHostPID" -}}
{{- if (include "nodeAnalyzer.deployBenchmarkRunner" .) }}
true
{{ else if and ((hasKey .Values.global.kspm "deploy") .Values.global.kspm.deploy) }}
{{ else if or (not (hasKey .Values.global.kspm "deploy")) .Values.global.kspm.deploy }}
true
{{- end -}}
{{- end -}}
Expand Down
24 changes: 24 additions & 0 deletions charts/node-analyzer/tests/conditional_flag_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,30 @@ tests:
apiVersion: v1
template: configmap-kspm-analyzer.yaml

- it: Check hostPID is true if global.kspm.deploy is true
set:
global:
kspm:
deploy: true
clusterName: test-cluster
template: daemonset-node-analyzer.yaml
asserts:
- equal:
path: spec.template.spec.hostPID
value: true

- it: Check hostPID is true if nodeAnalyzer.benchmarkRunner.deploy is true
set:
nodeAnalyzer:
benchmarkRunner:
deploy: true
clusterName: test-cluster
template: daemonset-node-analyzer.yaml
asserts:
- equal:
path: spec.template.spec.hostPID
value: true

- it: Check global kspm deploy without clusterName
set:
global:
Expand Down

0 comments on commit 3799843

Please sign in to comment.