Skip to content

Commit

Permalink
Changing sslVerifyCertificate flag logic, container value take the pr…
Browse files Browse the repository at this point in the history
…ecedence

Signed-off-by: Daniele De Lorenzi <[email protected]>
  • Loading branch information
dark-vex committed Nov 3, 2023
1 parent daf44fd commit 391b7a2
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions charts/node-analyzer/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -117,55 +117,40 @@ Return the proper image name for the CSPM Analyzer
Helper to define skip of SSL Certificate for Runtime Scanner and Eve Connector
*/}}
{{- define "runtimeScanner.sslVerifyCertificate" -}}
{{- if or (eq .Values.nodeAnalyzer.runtimeScanner.sslVerifyCertificate false) (eq .Values.nodeAnalyzer.sslVerifyCertificate false) (eq .Values.global.sslVerifyCertificate false) -}}
"false"
{{- else -}}
"true"
{{- end -}}
{{- $sslVerifyCertificate := coalesce (.Values.nodeAnalyzer.runtimeScanner.sslVerifyCertificate | quote) (.Values.nodeAnalyzer.sslVerifyCertificate | quote) (.Values.global.sslVerifyCertificate | quote) ("true" | quote) -}}
{{ $sslVerifyCertificate }}
{{- end -}}

{{/*
Helper to define skip of SSL Certificate for Host Scanner
*/}}
{{- define "hostScanner.sslVerifyCertificate" -}}
{{- if or (eq .Values.nodeAnalyzer.hostScanner.sslVerifyCertificate false) (eq .Values.nodeAnalyzer.sslVerifyCertificate false) (eq .Values.global.sslVerifyCertificate false) -}}
"false"
{{- else -}}
"true"
{{- end -}}
{{- $sslVerifyCertificate := coalesce (.Values.nodeAnalyzer.hostScanner.sslVerifyCertificate | quote) (.Values.nodeAnalyzer.sslVerifyCertificate | quote) (.Values.global.sslVerifyCertificate | quote) ("true" | quote) -}}
{{ $sslVerifyCertificate }}
{{- end -}}

{{/*
Helper to define skip of SSL Certificate for Host Analyzer
*/}}
{{- define "hostAnalyzer.sslVerifyCertificate" -}}
{{- if or (eq .Values.nodeAnalyzer.hostAnalyzer.sslVerifyCertificate false) (eq .Values.nodeAnalyzer.sslVerifyCertificate false) (eq .Values.global.sslVerifyCertificate false) -}}
"false"
{{- else -}}
"true"
{{- end -}}
{{- $sslVerifyCertificate := coalesce (.Values.nodeAnalyzer.hostAnalyzer.sslVerifyCertificate | quote) (.Values.nodeAnalyzer.sslVerifyCertificate | quote) (.Values.global.sslVerifyCertificate | quote) ("true" | quote) -}}
{{ $sslVerifyCertificate }}
{{- end -}}

{{/*
Helper to define skip of SSL Certificate for Image Analyzer
*/}}
{{- define "imageAnalyzer.sslVerifyCertificate" -}}
{{- if or (eq .Values.nodeAnalyzer.imageAnalyzer.sslVerifyCertificate false) (eq .Values.nodeAnalyzer.sslVerifyCertificate false) (eq .Values.global.sslVerifyCertificate false) -}}
"false"
{{- else -}}
"true"
{{- end -}}
{{- $sslVerifyCertificate := coalesce (.Values.nodeAnalyzer.imageAnalyzer.sslVerifyCertificate | quote) (.Values.nodeAnalyzer.sslVerifyCertificate | quote) (.Values.global.sslVerifyCertificate | quote) ("true" | quote) -}}
{{ $sslVerifyCertificate }}
{{- end -}}

{{/*
Helper to define skip of SSL Certificate for Benchmark Runner
*/}}
{{- define "benchmarkRunner.sslVerifyCertificate" -}}
{{- if or (eq .Values.nodeAnalyzer.benchmarkRunner.sslVerifyCertificate false) (eq .Values.nodeAnalyzer.sslVerifyCertificate false) (eq .Values.global.sslVerifyCertificate false) -}}
"false"
{{- else -}}
"true"
{{- end -}}
{{- $sslVerifyCertificate := coalesce (.Values.nodeAnalyzer.benchmarkRunner.sslVerifyCertificate | quote) (.Values.nodeAnalyzer.sslVerifyCertificate | quote) (.Values.global.sslVerifyCertificate | quote) ("true" | quote) -}}
{{ $sslVerifyCertificate }}
{{- end -}}

{{/*
Expand Down

0 comments on commit 391b7a2

Please sign in to comment.