Support IP addresses as hosts within keystone_endpoint_uri_lookup

This allows the keystone endpoint uri lookup function to
avoid adding a FQDN suffix to an IP address based host
entry.

Change-Id: I016e6512fb21182a8be9e3de1e4a2da59a20fb36
This commit is contained in:
Alan Meadows 2017-12-11 16:53:19 -08:00 committed by Pete Birley
parent 1c66ca1c12
commit 1af212c0ab

View File

@ -35,7 +35,11 @@ limitations under the License.
{{- $endpointPort := index $endpointPortMAP $endpoint | default (index $endpointPortMAP "default") }}
{{- $endpointPath := index .path $endpoint | default .path.default | default "/" }}
{{- $endpointClusterHostname := printf "%s.%s.%s" $endpointHost $namespace $clusterSuffix }}
{{- $endpointHostname := index .host_fqdn_override $endpoint | default .host_fqdn_override.default | default $endpointClusterHostname }}
{{- printf "%s://%s:%1.f%s" $endpointScheme $endpointHostname $endpointPort $endpointPath -}}
{{- if regexMatch "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+" $endpointHost }}
{{- printf "%s://%s:%1.f%s" $endpointScheme $endpointHost $endpointPort $endpointPath -}}
{{- else -}}
{{- $endpointFqdnHostname := index .host_fqdn_override $endpoint | default .host_fqdn_override.default | default $endpointClusterHostname }}
{{- printf "%s://%s:%1.f%s" $endpointScheme $endpointFqdnHostname $endpointPort $endpointPath -}}
{{- end -}}
{{- end -}}
{{- end -}}