From 2ce6f3226689504fc1fc3346a0b1f5dcbe36c24d Mon Sep 17 00:00:00 2001 From: portdirect Date: Tue, 27 Mar 2018 15:48:07 -0400 Subject: [PATCH] Glance: Move all config to be directly values driven. This PS moves all the config files to be directly values driven, both simplifying over-ride and allowing configs to be targeted to pods in future work. Change-Id: Ida5d9e312cc18cb50f5805a59f9fc4fef1a98658 --- glance/templates/configmap-etc.yaml | 3 +-- glance/templates/etc/_swift-store.conf.tpl | 30 ---------------------- glance/values.yaml | 18 ++++++++++--- 3 files changed, 16 insertions(+), 35 deletions(-) delete mode 100644 glance/templates/etc/_swift-store.conf.tpl diff --git a/glance/templates/configmap-etc.yaml b/glance/templates/configmap-etc.yaml index 9c5591cbb3..2fcf0d48e8 100644 --- a/glance/templates/configmap-etc.yaml +++ b/glance/templates/configmap-etc.yaml @@ -162,6 +162,5 @@ data: {{ include "helm-toolkit.utils.to_ini" .Values.conf.paste_registry | indent 4 }} policy.json: | {{ toJson .Values.conf.policy | indent 4 }} - swift-store.conf: | -{{- tuple .Values.conf.swift_store "etc/_swift-store.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} +{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.swift_store "key" "swift-store.conf") | indent 2 }} {{- end }} diff --git a/glance/templates/etc/_swift-store.conf.tpl b/glance/templates/etc/_swift-store.conf.tpl deleted file mode 100644 index a537857448..0000000000 --- a/glance/templates/etc/_swift-store.conf.tpl +++ /dev/null @@ -1,30 +0,0 @@ -{{/* -Copyright 2017 The Openstack-Helm Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/}} - -[{{ .Values.conf.glance.glance_store.default_swift_reference }}] -{{- if eq .Values.storage "radosgw" }} -auth_version = 1 -auth_address = {{ tuple "ceph_object_store" "public" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }} -user = {{ .Values.endpoints.ceph_object_store.auth.glance.username }}:swift -key = {{ .Values.endpoints.ceph_object_store.auth.glance.password }} -{{- else }} -user = {{ .Values.endpoints.identity.auth.glance.project_name }}:{{ .Values.endpoints.identity.auth.glance.username }} -key = {{ .Values.endpoints.identity.auth.glance.password }} -auth_address = {{ tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }} -user_domain_name = {{ .Values.endpoints.identity.auth.glance.user_domain_name }} -project_domain_name = {{ .Values.endpoints.identity.auth.glance.project_domain_name }} -auth_version = 3 -{{- end -}} diff --git a/glance/values.yaml b/glance/values.yaml index 60be4b5561..a7b091599b 100644 --- a/glance/values.yaml +++ b/glance/values.yaml @@ -278,9 +278,21 @@ conf: max_retries: -1 oslo_messaging_notifications: driver: messagingv2 - swift_store: - override: - append: + swift_store: | + [{{ .Values.conf.glance.glance_store.default_swift_reference }}] + {{- if eq .Values.storage "radosgw" }} + auth_version = 1 + auth_address = {{ tuple "ceph_object_store" "public" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }} + user = {{ .Values.endpoints.ceph_object_store.auth.glance.username }}:swift + key = {{ .Values.endpoints.ceph_object_store.auth.glance.password }} + {{- else }} + user = {{ .Values.endpoints.identity.auth.glance.project_name }}:{{ .Values.endpoints.identity.auth.glance.username }} + key = {{ .Values.endpoints.identity.auth.glance.password }} + auth_address = {{ tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }} + user_domain_name = {{ .Values.endpoints.identity.auth.glance.user_domain_name }} + project_domain_name = {{ .Values.endpoints.identity.auth.glance.project_domain_name }} + auth_version = 3 + {{- end -}} network: api: