Set tempest.dashboard.dashboard_url parameter

Set parameter dynamically from endpoints.

Change-Id: Iac354a57fa4ec2e22c8773635fd407588327249c
This commit is contained in:
Vasyl Saienko 2019-08-15 07:25:39 +00:00
parent a66ecbf7ad
commit bd8f9c3477
2 changed files with 41 additions and 0 deletions

View File

@ -37,6 +37,25 @@ limitations under the License.
{{- $_ := set .Values.conf.tempest.identity "region" .Values.endpoints.identity.auth.admin.region_name -}} {{- $_ := set .Values.conf.tempest.identity "region" .Values.endpoints.identity.auth.admin.region_name -}}
{{- end -}} {{- end -}}
{{- if empty .Values.conf.tempest.dashboard.dashboard_url -}}
{{- $endpointScheme := tuple "dashboard" "public" "web" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" }}
{{- $endpointHost := tuple "dashboard" "public" . | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
{{- $endpointPort := tuple "dashboard" "public" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- $endpointPath := tuple "dashboard" "public" "web" . | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }}
# When CSRF protection is enabled Refferer and Host header should match.
# Common browsers doesn't add default ports like 80 and 443 to the headers
# Use the same logic here to make sure test passed when CSRF protection is enabled and
# we using default port numbers. More info may be found here:
# * https://code.djangoproject.com/ticket/26037
# * https://stackoverflow.com/questions/27533011/django-csrf-error-casused-by-nginx-x-forwarded-host
{{- if eq $endpointPort "80" "443" }}
{{- printf "%s://%s%s" $endpointScheme $endpointHost $endpointPath | set .Values.conf.tempest.dashboard "dashboard_url" }}
{{- else }}
{{- printf "%s://%s:%s%s" $endpointScheme $endpointHost $endpointPort $endpointPath | set .Values.conf.tempest.dashboard "dashboard_url" }}
{{- end }}
{{- end -}}
--- ---
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret

View File

@ -135,6 +135,7 @@ conf:
# admin_domain_name value set by configmap-etc # admin_domain_name value set by configmap-etc
admin_domain_name: null admin_domain_name: null
use_dynamic_credentials: true use_dynamic_credentials: true
dashboard: {}
identity: identity:
admin_domain_scope: false admin_domain_scope: false
auth_version: v3 auth_version: v3
@ -296,6 +297,27 @@ endpoints:
api: api:
default: 80 default: 80
internal: 5000 internal: 5000
dashboard:
name: horizon
hosts:
default: horizon-int
public: horizon
host_fqdn_override:
default: null
# NOTE(portdirect): this chart supports TLS for fqdn over-ridden public
# endpoints using the following format:
# public:
# host: null
# tls:
# crt: null
# key: null
path:
default: null
scheme:
default: http
port:
web:
default: 80
manifests: manifests:
configmap_bin: true configmap_bin: true