From f461409a06551d2d44fecd142decd7787bcac26a Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Wed, 19 Jan 2022 00:53:28 +0100 Subject: [PATCH] Add indentation for improved readability --- jupyterhub/templates/_helpers.tpl | 42 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/jupyterhub/templates/_helpers.tpl b/jupyterhub/templates/_helpers.tpl index ad7f421aa6..eecdc8995b 100644 --- a/jupyterhub/templates/_helpers.tpl +++ b/jupyterhub/templates/_helpers.tpl @@ -201,30 +201,30 @@ component: {{ include "jupyterhub.componentLabel" . }} {{- end }} {{- end }} -{{- /* Populate $_.list with all relevant entries */}} -{{- $_ := dict "list" (concat .image.pullSecrets $jupyterhub_values.imagePullSecrets | uniq) }} -{{- if and $jupyterhub_values.imagePullSecret.create $jupyterhub_values.imagePullSecret.automaticReferenceInjection }} -{{- $__ := set $_ "list" (append $_.list (include "jupyterhub.image-pull-secret.fullname" .root) | uniq) }} -{{- end }} - -{{- /* Decide if something should be written */}} -{{- if not (eq ($_.list | toJson) "[]") }} + {{- /* Populate $_.list with all relevant entries */}} + {{- $_ := dict "list" (concat .image.pullSecrets $jupyterhub_values.imagePullSecrets | uniq) }} + {{- if and $jupyterhub_values.imagePullSecret.create $jupyterhub_values.imagePullSecret.automaticReferenceInjection }} + {{- $__ := set $_ "list" (append $_.list (include "jupyterhub.image-pull-secret.fullname" .root) | uniq) }} + {{- end }} -{{- /* Process the $_.list where strings become dicts with a name key and the -strings become the name keys' values into $_.res */}} -{{- $_ := set $_ "res" list }} -{{- range $_.list }} -{{- if eq (typeOf .) "string" }} -{{- $__ := set $_ "res" (append $_.res (dict "name" .)) }} -{{- else }} -{{- $__ := set $_ "res" (append $_.res .) }} -{{- end }} -{{- end }} + {{- /* Decide if something should be written */}} + {{- if not (eq ($_.list | toJson) "[]") }} + + {{- /* Process the $_.list where strings become dicts with a name key and the + strings become the name keys' values into $_.res */}} + {{- $_ := set $_ "res" list }} + {{- range $_.list }} + {{- if eq (typeOf .) "string" }} + {{- $__ := set $_ "res" (append $_.res (dict "name" .)) }} + {{- else }} + {{- $__ := set $_ "res" (append $_.res .) }} + {{- end }} + {{- end }} -{{- /* Write the results */}} -{{- $_.res | toJson }} + {{- /* Write the results */}} + {{- $_.res | toJson }} -{{- end }} + {{- end }} {{- end }} {{- /*