Skip to content

Commit

Permalink
Fixed lookup-based validations
Browse files Browse the repository at this point in the history
Since new `$messages` variable was always declared alongside the assignment, the statements inside the inner `if` scope were not modifying the variable declared in outer scope
  • Loading branch information
blaskoa committed Nov 2, 2023
1 parent 4649ff4 commit 64c584e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions templates/_validations.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ Compile all warnings into a single message, and call fail.
{{- define "smartface.validate" -}}
{{- $messages := list -}}

{{- $messages := append $messages (trim (include "smartface.validate.multitenantEdge" .)) -}}
{{- $messages := append $messages (trim (include "smartface.validate.stationDeps" .)) -}}
{{- $messages = append $messages (trim (include "smartface.validate.multitenantEdge" .)) -}}
{{- $messages = append $messages (trim (include "smartface.validate.stationDeps" .)) -}}

{{- if not .Values.skipLookupBasedValidations -}}
{{- $messages := append $messages (trim (include "smartface.validate.dbConnectionSecret" .)) -}}
{{- $messages := append $messages (trim (include "smartface.validate.s3Config" .)) -}}
{{- $messages := append $messages (trim (include "smartface.validate.licenseSecret" .)) -}}
{{- $messages := append $messages (trim (include "smartface.validate.authConfig" .)) -}}
{{- $messages := append $messages (trim (include "smartface.validate.registryCreds" .)) -}}
{{- $messages := append $messages (trim (include "smartface.validate.rmqConfig" .)) -}}
{{- $messages := append $messages (trim (include "smartface.validate.mqttConfig" .)) -}}
{{- $messages = append $messages (trim (include "smartface.validate.dbConnectionSecret" .)) -}}
{{- $messages = append $messages (trim (include "smartface.validate.s3Config" .)) -}}
{{- $messages = append $messages (trim (include "smartface.validate.licenseSecret" .)) -}}
{{- $messages = append $messages (trim (include "smartface.validate.authConfig" .)) -}}
{{- $messages = append $messages (trim (include "smartface.validate.registryCreds" .)) -}}
{{- $messages = append $messages (trim (include "smartface.validate.rmqConfig" .)) -}}
{{- $messages = append $messages (trim (include "smartface.validate.mqttConfig" .)) -}}
{{- end -}}

{{- $messages := without $messages "" -}}
{{- $messages = without $messages "" -}}
{{- $message := join "\n" $messages -}}
{{- if $message -}}
{{- printf "\nVALIDATIONS:\n%s" $message | fail -}}
Expand Down

0 comments on commit 64c584e

Please sign in to comment.