fix(homepage): use servicename, port and svc suffix, via targetselector, to connect to chart

This commit is contained in:
Kjeld Schouten
2023-12-23 22:27:41 +01:00
committed by GitHub
parent 9ca9146972
commit a19df144bb

View File

@@ -9,6 +9,7 @@
{{- end -}}
{{- include "tc.v1.common.lib.ingress.integration.homepage.validation" (dict "objectData" $objectData) -}}
{{- $svcData := (include "tc.v1.common.lib.ingress.targetSelector" (dict "rootCtx" $rootCtx "objectData" $objectData) | fromYaml) -}}
{{- $name := $homepage.name | default ($rootCtx.Chart.Name | camelcase) -}}
{{- $desc := $homepage.description | default $rootCtx.Chart.Description -}}
@@ -23,7 +24,14 @@
{{- $host := tpl $fHost.host $rootCtx -}}
{{- $path := tpl $fPath.path $rootCtx -}}
{{- $href = printf "https://%s/%s/" $host ($path | trimPrefix "/") -}}
{{- $href = printf "https://%s/%s" $host ($path | trimPrefix "/") -}}
{{- end -}}
{{- if not $url -}}
{{- $svc := $svcData.name -}}
{{- $port := $svcData.port -}}
{{- $url = printf "http://%s.svc:%s" $svc $port -}}
{{- end -}}
{{- $_ := set $objectData.annotations "gethomepage.dev/enabled" "true" -}}