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

[charts/cosi] correct cosi log level setting #288

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions charts/cosi/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ Create chart name and version as used by the chart label.

{{/*
# COSI driver log level
# Values are set to the integer value, higher value means more verbose logging
# Possible values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
# Default value: 4
*/}}
{{- define "cosi.logLevel" }}
{{- $logLevelValues := list 0 1 2 3 4 5 6 7 8 9 10 }}
{{- if (has .Values.provisioner.logLevel $logLevelValues) }}
{{- .Values.provisioner.logLevel }}
{{- if (kindIs "int64" .Values.provisioner.logLevel) }}
{{- if (or (ge .Values.provisioner.logLevel 0) (le .Values.provisioner.logLevel 10)) }}
{{- .Values.provisioner.logLevel }}
{{- else }}
{{- 4 }}
{{- end }}
{{- else }}
{{- 4 }}
{{- end }}
Expand All @@ -47,12 +51,18 @@ Create chart name and version as used by the chart label.
{{/*
# COSI driver sidecar log level
# Values are set to the integer value, higher value means more verbose logging
# Possible values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
# Default value: 4
*/}}
{{- define "cosi.provisionerSidecarVerbosity" }}
{{- if (kindIs "int" .Values.sidecar.verbosity) }}
{{- .Values.sidecar.verbosity }}
{{- if (kindIs "int64" .Values.sidecar.verbosity) }}
{{- if (or (ge .Values.sidecar.verbosity 0) (le .Values.sidecar.verbosity 10)) }}
{{- .Values.sidecar.verbosity }}
{{- else }}
{{- 4 }}
{{- end }}
{{- else }}
{{- 5 }}
{{- 4 }}
{{- end }}
{{- end }}

Expand Down