Browse Source

Merge pull request #13804 from richardkchapman/defaultEsp

HPCC-24135 Can't start a cloud system without an esp

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 5 years ago
parent
commit
981df282fa
2 changed files with 14 additions and 1 deletions
  1. 13 1
      dockerfiles/hpcc/templates/_helpers.tpl
  2. 1 0
      dockerfiles/hpcc/templates/esp.yaml

+ 13 - 1
dockerfiles/hpcc/templates/_helpers.tpl

@@ -47,9 +47,21 @@ Generate global ConfigMap info
 Pass in root as .
 */}}
 {{- define "hpcc.generateGlobalConfigMap" -}}
+{{- $local := dict "defaultEsp" "" -}}
 imageVersion: {{ required "Please specify .global.image.version" .Values.global.image.version | quote }}
 singleNode: {{ .Values.global.singleNode | default false }}
-defaultEsp: {{ .Values.global.defaultEsp | default (index .Values.esp 0).name }}
+{{- if .Values.global.defaultEsp -}}
+ {{- $_ := set $local "defaultEsp" .Values.global.defaultEsp -}}
+{{- else if hasPrefix "[]" (typeOf .Values.esp) -}}
+ {{- range $key, $value := .Values.esp -}}
+  {{- if (not $value.disabled) -}}
+   {{- if (not $local.defaultEsp) -}}
+    {{- $_ := set $local "defaultEsp" $value.name -}}
+   {{- end -}} 
+  {{- end -}} 
+ {{- end -}} 
+{{- end }} 
+defaultEsp: {{ $local.defaultEsp | quote }}
 {{- end -}}
 
 {{/*

+ 1 - 0
dockerfiles/hpcc/templates/esp.yaml

@@ -58,5 +58,6 @@ spec:
   selector:
     run: {{ .name | quote }}
   type: LoadBalancer
+---
 {{- end }}
 {{- end }}