@@ -3,12 +3,12 @@ Returns port configuration.
33Values are selected with the following precedence:
441. .Values.ports (chart specific overrides)
552. .Values.global.aserto.ports (global overrides)
6- 3. default values ({grpc: 8282, https : 8383, health: 8484, metrics: 8585})
6+ 3. default values ({grpc: 8282, http : 8383, health: 8484, metrics: 8585})
77*/ }}
88{{- define " aserto-lib.ports" }}
99{{- $scope := first . }}
1010{{- $svc := last . }}
11- {{- $defaults := dict " grpc" 8282 " https " 8383 " health" 8484 " metrics" 8585}}
11+ {{- $defaults := dict " grpc" 8282 " http " 8383 " health" 8484 " metrics" 8585}}
1212{{- $global := ($scope .global ).aserto | default dict | dig " ports" dict }}
1313{{- $local := $svc | eq " self" | ternary $scope .ports (dig " global" " aserto" $svc " ports" dict $scope .AsMap ) }}
1414{{- merge $local $global $defaults | toYaml }}
@@ -22,8 +22,8 @@ Values are selected with the following precedence:
2222{{- (include " aserto-lib.ports" (list . " self" ) | fromYaml).grpc }}
2323{{- end }}
2424
25- {{- define " aserto-lib.httpsPort " }}
26- {{- (include " aserto-lib.ports" (list . " self" ) | fromYaml).https }}
25+ {{- define " aserto-lib.httpPort " }}
26+ {{- (include " aserto-lib.ports" (list . " self" ) | fromYaml).http }}
2727{{- end }}
2828
2929{{- define " aserto-lib.healthPort" }}
@@ -34,3 +34,17 @@ Values are selected with the following precedence:
3434{{- (include " aserto-lib.ports" (list . " self" ) | fromYaml).metrics }}
3535{{- end }}
3636
37+ {{- define " aserto-lib.ingressDomain" -}}
38+ {{ (.Values.ingress ).domain | default (((.Values.global ).aserto ).ingress ).domain }}
39+ {{- end }}
40+
41+ {{- define " aserto-lib.ingressHost" -}}
42+ {{- $scope := first . -}}
43+ {{- $svc := last . -}}
44+ {{- $domain := include " aserto-lib.ingressDomain" $scope -}}
45+ {{- if $domain -}}
46+ {{ printf " %s .%s " $svc .subdomain $domain | quote }}
47+ {{- else -}}
48+ {{ $svc .host | quote | required " ingress.hosts[].host is required if ingress.domain is empty" }}
49+ {{- end -}}
50+ {{- end }}
0 commit comments