Rico Lin | d020bc2 | 2023-11-01 01:57:03 +0800 | [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.clouds.clouds.envvars.auth.auth_url -}} |
| 19 | {{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.clouds.clouds.envvars.auth "auth_url" -}} |
| 20 | {{- end -}} |
| 21 | |
| 22 | {{- if empty .Values.conf.clouds.clouds.envvars.auth.project_name -}} |
| 23 | {{- $_ := set .Values.conf.clouds.clouds.envvars.auth "project_name" .Values.endpoints.identity.auth.admin.project_name -}} |
| 24 | {{- end -}} |
| 25 | {{- if empty .Values.conf.clouds.clouds.envvars.auth.project_domain_name -}} |
| 26 | {{- $_ := set .Values.conf.clouds.clouds.envvars.auth "project_domain_name" .Values.endpoints.identity.auth.admin.project_domain_name -}} |
| 27 | {{- end -}} |
| 28 | {{- if empty .Values.conf.clouds.clouds.envvars.auth.user_domain_name -}} |
| 29 | {{- $_ := set .Values.conf.clouds.clouds.envvars.auth "user_domain_name" .Values.endpoints.identity.auth.admin.user_domain_name -}} |
| 30 | {{- end -}} |
| 31 | {{- if empty .Values.conf.clouds.clouds.envvars.auth.username -}} |
| 32 | {{- $_ := set .Values.conf.clouds.clouds.envvars.auth "username" .Values.endpoints.identity.auth.admin.username -}} |
| 33 | {{- end -}} |
| 34 | {{- if empty .Values.conf.clouds.clouds.envvars.auth.password -}} |
| 35 | {{- $_ := set .Values.conf.clouds.clouds.envvars.auth "password" .Values.endpoints.identity.auth.admin.password -}} |
| 36 | {{- end -}} |
| 37 | {{- if empty .Values.conf.clouds.clouds.envvars.region_name -}} |
| 38 | {{- $_ := set .Values.conf.clouds.clouds.envvars "region_name" .Values.endpoints.identity.auth.admin.region_name -}} |
| 39 | {{- end -}} |
| 40 | |
| 41 | {{- if empty .Values.conf.staffeln.database.connection -}} |
| 42 | {{- $_ := tuple "oslo_db" "internal" "staffeln" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.staffeln.database "connection" -}} |
| 43 | {{- end -}} |
| 44 | |
| 45 | {{- if and (empty .Values.conf.logging.handler_fluent) (has "fluent" .Values.conf.logging.handlers.keys) -}} |
| 46 | {{- $fluentd_host := tuple "fluentd" "internal" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }} |
| 47 | {{- $fluentd_port := tuple "fluentd" "internal" "service" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }} |
| 48 | {{- $fluent_args := printf "('%s.%s', '%s', %s)" .Release.Namespace .Release.Name $fluentd_host $fluentd_port }} |
| 49 | {{- $handler_fluent := dict "class" "fluent.handler.FluentHandler" "formatter" "fluent" "args" $fluent_args -}} |
| 50 | {{- $_ := set .Values.conf.logging "handler_fluent" $handler_fluent -}} |
| 51 | {{- end -}} |
| 52 | |
| 53 | {{- if and (empty .Values.conf.logging.formatter_fluent) (has "fluent" .Values.conf.logging.formatters.keys) -}} |
| 54 | {{- $formatter_fluent := dict "class" "oslo_log.formatters.FluentFormatter" -}} |
| 55 | {{- $_ := set .Values.conf.logging "formatter_fluent" $formatter_fluent -}} |
| 56 | {{- end -}} |
| 57 | --- |
| 58 | apiVersion: v1 |
| 59 | kind: Secret |
| 60 | metadata: |
| 61 | name: staffeln-etc |
| 62 | type: Opaque |
| 63 | data: |
| 64 | staffeln.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.staffeln | b64enc }} |
| 65 | openrc: {{ include "staffeln.templates.openrc" . | b64enc }} |
| 66 | {{- end }} |