Skip to content

Commit

Permalink
Add indentation for improved readability
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Jan 18, 2022
1 parent 98df189 commit f461409
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions jupyterhub/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
{{- /*
Expand Down

0 comments on commit f461409

Please sign in to comment.