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 }}
{{- $nodeSelector := dict .Values.labels.job.node_selector_key .Values.labels.job.node_selector_value }}
{{- $dependencies := .Values.dependencies.ks_user }}
{{- $ksUserJob := dict "envAll" . "nodeSelector" $nodeSelector "dependencies" $dependencies "configMapBin" "barbican-bin" "serviceName" "barbican" "serviceUser" "barbican" }}
{{- $ksUserJob := dict "envAll" . "serviceName" "barbican" -}}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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