HTK: Update host and port function to call correct host function

This PS updates the host and port function to call the correct
host function to allow ip addresses to be rendered if required.

Change-Id: I55c91bd911875b537a54ac76cda03a126649af80
Signed-off-by: Pete Birley <pete@port.direct>
This commit is contained in:
Pete Birley 2019-01-28 12:14:20 -06:00
parent 26fd3f6be3
commit 633d99c2ff

View File

@ -17,21 +17,37 @@ limitations under the License.
{{/* {{/*
abstract: | abstract: |
Resolves 'hostname:port' for an endpoint Resolves 'hostname:port' for an endpoint
values: | examples:
endpoints: - values: |
cluster_domain_suffix: cluster.local endpoints:
oslo_db: cluster_domain_suffix: cluster.local
hosts: oslo_db:
default: mariadb hosts:
host_fqdn_override: default: mariadb
default: null host_fqdn_override:
port: default: null
mysql: port:
default: 3306 mysql:
usage: | default: 3306
{{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" }} usage: |
return: | {{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" }}
mariadb.default.svc.cluster.local:3306 return: |
mariadb.default.svc.cluster.local:3306
- values: |
endpoints:
cluster_domain_suffix: cluster.local
oslo_db:
hosts:
default: 127.0.0.1
host_fqdn_override:
default: null
port:
mysql:
default: 3306
usage: |
{{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" }}
return: |
127.0.0.1:3306
*/}} */}}
{{- define "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" -}} {{- define "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" -}}
@ -40,6 +56,6 @@ return: |
{{- $port := index . 2 -}} {{- $port := index . 2 -}}
{{- $context := index . 3 -}} {{- $context := index . 3 -}}
{{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- $endpointHostname := tuple $type $endpoint $context | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }} {{- $endpointHostname := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
{{- printf "%s:%s" $endpointHostname $endpointPort -}} {{- printf "%s:%s" $endpointHostname $endpointPort -}}
{{- end -}} {{- end -}}