Mohammed Naser | dd9bbd1 | 2023-01-18 02:52:43 +0000 | [diff] [blame] | 1 | {{/* |
| 2 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | you may not use this file except in compliance with the License. |
| 4 | You may obtain a copy of the License at |
| 5 | |
| 6 | http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | |
| 8 | Unless required by applicable law or agreed to in writing, software |
| 9 | distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | See the License for the specific language governing permissions and |
| 12 | limitations under the License. |
| 13 | */}} |
| 14 | |
| 15 | {{- if .Values.manifests.configmap_etc }} |
| 16 | {{- $envAll := . }} |
| 17 | |
| 18 | {{- if empty .Values.conf.tempest.auth.admin_username -}} |
| 19 | {{- $_ := set .Values.conf.tempest.auth "admin_username" .Values.endpoints.identity.auth.admin.username -}} |
| 20 | {{- end -}} |
| 21 | {{- if empty .Values.conf.tempest.auth.admin_password -}} |
| 22 | {{- $_ := set .Values.conf.tempest.auth "admin_password" .Values.endpoints.identity.auth.admin.password -}} |
| 23 | {{- end -}} |
| 24 | {{- if empty .Values.conf.tempest.auth.admin_project_name -}} |
| 25 | {{- $_ := set .Values.conf.tempest.auth "admin_project_name" .Values.endpoints.identity.auth.admin.project_name -}} |
| 26 | {{- end -}} |
| 27 | {{- if empty .Values.conf.tempest.auth.admin_domain_name -}} |
| 28 | {{- $_ := set .Values.conf.tempest.auth "admin_domain_name" .Values.endpoints.identity.auth.admin.user_domain_name -}} |
| 29 | {{- end -}} |
| 30 | |
| 31 | {{- if empty .Values.conf.tempest.identity.uri_v3 -}} |
| 32 | {{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.tempest.identity "uri_v3" -}} |
| 33 | {{- end -}} |
| 34 | {{- if empty .Values.conf.tempest.identity.region -}} |
| 35 | {{- $_ := set .Values.conf.tempest.identity "region" .Values.endpoints.identity.auth.admin.region_name -}} |
| 36 | {{- end -}} |
| 37 | |
Oleksandr Kozachenko | a10d785 | 2023-02-02 22:01:16 +0100 | [diff] [blame] | 38 | {{- if .Values.conf.tempest.service_available.heat -}} |
| 39 | {{- if empty .Values.conf.tempest.heat_plugin.username -}} |
| 40 | {{- $_ := set .Values.conf.tempest.heat_plugin "username" .Values.endpoints.identity.auth.tempest.username -}} |
| 41 | {{- end -}} |
| 42 | {{- if empty .Values.conf.tempest.heat_plugin.password -}} |
| 43 | {{- $_ := set .Values.conf.tempest.heat_plugin "password" .Values.endpoints.identity.auth.tempest.password -}} |
| 44 | {{- end -}} |
| 45 | {{- if empty .Values.conf.tempest.heat_plugin.project_name -}} |
| 46 | {{- $_ := set .Values.conf.tempest.heat_plugin "project_name" .Values.endpoints.identity.auth.tempest.project_name -}} |
| 47 | {{- end -}} |
| 48 | {{- if empty .Values.conf.tempest.heat_plugin.admin_username -}} |
| 49 | {{- $_ := set .Values.conf.tempest.heat_plugin "admin_username" .Values.endpoints.identity.auth.admin.username -}} |
| 50 | {{- end -}} |
| 51 | {{- if empty .Values.conf.tempest.heat_plugin.admin_password -}} |
| 52 | {{- $_ := set .Values.conf.tempest.heat_plugin "admin_password" .Values.endpoints.identity.auth.admin.password -}} |
| 53 | {{- end -}} |
| 54 | {{- if empty .Values.conf.tempest.heat_plugin.admin_project_name -}} |
| 55 | {{- $_ := set .Values.conf.tempest.heat_plugin "admin_project_name" .Values.endpoints.identity.auth.admin.project_name -}} |
| 56 | {{- end -}} |
| 57 | {{- if empty .Values.conf.tempest.heat_plugin.auth_url -}} |
| 58 | {{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.tempest.heat_plugin "auth_url" -}} |
| 59 | {{- end -}} |
| 60 | {{- if empty .Values.conf.tempest.heat_plugin.region -}} |
| 61 | {{- $_ := set .Values.conf.tempest.heat_plugin "region" .Values.endpoints.identity.auth.admin.region_name -}} |
| 62 | {{- end -}} |
| 63 | {{- if empty .Values.conf.tempest.heat_plugin.project_domain_name -}} |
| 64 | {{- $_ := set .Values.conf.tempest.heat_plugin "project_domain_name" .Values.endpoints.identity.auth.tempest.project_domain_name -}} |
| 65 | {{- end -}} |
| 66 | {{- if empty .Values.conf.tempest.heat_plugin.user_domain_name -}} |
| 67 | {{- $_ := set .Values.conf.tempest.heat_plugin "user_domain_name" .Values.endpoints.identity.auth.tempest.user_domain_name -}} |
| 68 | {{- end -}} |
| 69 | {{- end -}} |
Mohammed Naser | dd9bbd1 | 2023-01-18 02:52:43 +0000 | [diff] [blame] | 70 | |
| 71 | {{- if empty .Values.conf.tempest.dashboard.dashboard_url -}} |
| 72 | {{- $endpointScheme := tuple "dashboard" "public" "web" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" }} |
| 73 | {{- $endpointHost := tuple "dashboard" "public" . | include "helm-toolkit.endpoints.endpoint_host_lookup" }} |
| 74 | {{- $endpointPort := tuple "dashboard" "public" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} |
| 75 | {{- $endpointPath := tuple "dashboard" "public" "web" . | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }} |
| 76 | # When CSRF protection is enabled Refferer and Host header should match. |
| 77 | # Common browsers doesn't add default ports like 80 and 443 to the headers |
| 78 | # Use the same logic here to make sure test passed when CSRF protection is enabled and |
| 79 | # we using default port numbers. More info may be found here: |
| 80 | # * https://code.djangoproject.com/ticket/26037 |
| 81 | # * https://stackoverflow.com/questions/27533011/django-csrf-error-casused-by-nginx-x-forwarded-host |
| 82 | {{- if eq $endpointPort "80" "443" }} |
| 83 | {{- printf "%s://%s%s" $endpointScheme $endpointHost $endpointPath | set .Values.conf.tempest.dashboard "dashboard_url" }} |
| 84 | {{- else }} |
| 85 | {{- printf "%s://%s:%s%s" $endpointScheme $endpointHost $endpointPort $endpointPath | set .Values.conf.tempest.dashboard "dashboard_url" }} |
| 86 | {{- end }} |
| 87 | {{- end -}} |
| 88 | |
| 89 | --- |
| 90 | apiVersion: v1 |
| 91 | kind: Secret |
| 92 | metadata: |
| 93 | name: tempest-etc |
| 94 | type: Opaque |
| 95 | data: |
| 96 | tempest.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.tempest | b64enc }} |
| 97 | logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.tempest_logging | b64enc }} |
| 98 | {{ if not (empty .Values.conf.blacklist) }} |
| 99 | test-blacklist: {{ include "tempest.utils.to_regex_file" .Values.conf.blacklist | b64enc }} |
| 100 | {{ end }} |
| 101 | {{ if not (empty .Values.conf.whitelist) }} |
| 102 | test-whitelist: {{ include "tempest.utils.to_regex_file" .Values.conf.whitelist | b64enc }} |
| 103 | {{ end }} |
| 104 | {{- end }} |