From 633d99c2ff444ec1767adb80852922297e1f835b Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Mon, 28 Jan 2019 12:14:20 -0600 Subject: [PATCH] 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 --- .../_host_and_port_endpoint_uri_lookup.tpl | 48 ++++++++++++------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/helm-toolkit/templates/endpoints/_host_and_port_endpoint_uri_lookup.tpl b/helm-toolkit/templates/endpoints/_host_and_port_endpoint_uri_lookup.tpl index 39107bfb4..4bb00736b 100644 --- a/helm-toolkit/templates/endpoints/_host_and_port_endpoint_uri_lookup.tpl +++ b/helm-toolkit/templates/endpoints/_host_and_port_endpoint_uri_lookup.tpl @@ -17,21 +17,37 @@ limitations under the License. {{/* abstract: | Resolves 'hostname:port' for an endpoint -values: | - endpoints: - cluster_domain_suffix: cluster.local - oslo_db: - hosts: - default: mariadb - 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: | - mariadb.default.svc.cluster.local:3306 +examples: + - values: | + endpoints: + cluster_domain_suffix: cluster.local + oslo_db: + hosts: + default: mariadb + 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: | + 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" -}} @@ -40,6 +56,6 @@ return: | {{- $port := index . 2 -}} {{- $context := index . 3 -}} {{- $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 -}} {{- end -}}