Keystone: update user jobs to use defaults in dict keys

This PS updates the Keystone user job template to use default
values when not specified via the input dict.

Change-Id: I937e720ab3ab4ba70c33ea981d7693ebfd01c894
This commit is contained in:
portdirect 2018-02-07 10:57:22 -05:00
parent b4d513c3bd
commit 72792a49d4
16 changed files with 20 additions and 52 deletions

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user }} {{- if .Values.manifests.job_ks_user }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "barbican" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "barbican-bin" "serviceName" "barbican" "serviceUser" "barbican" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user }} {{- if .Values.manifests.job_ks_user }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "ceilometer" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "ceilometer-bin" "serviceName" "ceilometer" "serviceUser" "ceilometer" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if and .Values.manifests.job_ks_user .Values.deployment.rgw_keystone_user_and_endpoints }} {{- if and .Values.manifests.job_ks_user .Values.deployment.rgw_keystone_user_and_endpoints }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "configMapBin" "ceph-bin-ks" "serviceName" "ceph" "serviceUser" "swift" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "ceph-bin-ks" "serviceName" "ceph" "serviceUser" "swift" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user }} {{- if .Values.manifests.job_ks_user }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "cinder" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "cinder-bin" "serviceName" "cinder" "serviceUser" "cinder" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user }} {{- if .Values.manifests.job_ks_user }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "congress" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "congress-bin" "serviceName" "congress" "serviceUser" "congress" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user }} {{- if .Values.manifests.job_ks_user }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "glance" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "glance-bin" "serviceName" "glance" "serviceUser" "glance" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user }} {{- if .Values.manifests.job_ks_user }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "gnocchi" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "gnocchi-bin" "serviceName" "gnocchi" "serviceUser" "gnocchi" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user_trustee }} {{- if .Values.manifests.job_ks_user_trustee }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "heat" "serviceUser" "heat_trustee" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "heat-bin" "serviceName" "heat" "serviceUser" "heat_trustee" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user }} {{- if .Values.manifests.job_ks_user }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "heat" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "heat-bin" "serviceName" "heat" "serviceUser" "heat" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -16,18 +16,16 @@ limitations under the License.
# This function creates a manifest for keystone user management. # This function creates a manifest for keystone user management.
# It can be used in charts dict created similar to the following: # It can be used in charts dict created similar to the following:
# {- $nodeSelector := dict .Values.labels.node_selector_key .Values.labels.node_selector_value } # {- $ksUserJob := dict "envAll" . "serviceName" "senlin" }
# {- $dependencies := .Values.dependencies.ks_user }
# {- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "senlin-bin" "serviceName" "senlin" "serviceUser" "senlin" }
# { $ksUserJob | include "helm-toolkit.manifests.job_ks_user" } # { $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }
{{- define "helm-toolkit.manifests.job_ks_user" -}} {{- define "helm-toolkit.manifests.job_ks_user" -}}
{{- $envAll := index . "envAll" -}} {{- $envAll := index . "envAll" -}}
{{- $nodeSelector := index . "nodeSelector" -}}
{{- $dependencies := index . "dependencies" -}}
{{- $configMapBin := index . "configMapBin" -}}
{{- $serviceName := index . "serviceName" -}} {{- $serviceName := index . "serviceName" -}}
{{- $serviceUser := index . "serviceUser" -}} {{- $nodeSelector := index . "nodeSelector" | default ( dict $envAll.Values.labels.job.node_selector_key $envAll.Values.labels.job.node_selector_value ) -}}
{{- $dependencies := index . "dependencies" | default $envAll.Values.dependencies.ks_user -}}
{{- $configMapBin := index . "configMapBin" | default (printf "%s-%s" $serviceName "bin" ) -}}
{{- $serviceUser := index . "serviceUser" | default $serviceName -}}
{{- $serviceUserPretty := $serviceUser | replace "_" "-" -}} {{- $serviceUserPretty := $serviceUser | replace "_" "-" -}}
{{- $serviceAccountName := printf "%s-%s" $serviceUserPretty "ks-user" }} {{- $serviceAccountName := printf "%s-%s" $serviceUserPretty "ks-user" }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user }} {{- if .Values.manifests.job_ks_user }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "magnum" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "magnum-bin" "serviceName" "magnum" "serviceUser" "magnum" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user }} {{- if .Values.manifests.job_ks_user }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "mistral" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "mistral-bin" "serviceName" "mistral" "serviceUser" "mistral" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user }} {{- if .Values.manifests.job_ks_user }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "neutron" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "neutron-bin" "serviceName" "neutron" "serviceUser" "neutron" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user }} {{- if .Values.manifests.job_ks_user }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "nova" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "nova-bin" "serviceName" "nova" "serviceUser" "nova" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user }} {{- if .Values.manifests.job_ks_user }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "rally" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "rally-bin" "serviceName" "rally" "serviceUser" "rally" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}

View File

@ -15,8 +15,6 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.job_ks_user }} {{- if .Values.manifests.job_ks_user }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }} {{- $ksUserJob := dict "envAll" . "serviceName" "senlin" -}}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "senlin-bin" "serviceName" "senlin" "serviceUser" "senlin" }}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }} {{- end }}