diff --git a/barbican/templates/job-ks-user.yaml b/barbican/templates/job-ks-user.yaml index b333b76fd8..c83ef4d0f9 100644 --- a/barbican/templates/job-ks-user.yaml +++ b/barbican/templates/job-ks-user.yaml @@ -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 }} diff --git a/ceilometer/templates/job-ks-user.yaml b/ceilometer/templates/job-ks-user.yaml index e3632004a9..6ce566454e 100644 --- a/ceilometer/templates/job-ks-user.yaml +++ b/ceilometer/templates/job-ks-user.yaml @@ -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 }} diff --git a/ceph/templates/job-ks-user.yaml b/ceph/templates/job-ks-user.yaml index 184c46d846..80c5b1e579 100644 --- a/ceph/templates/job-ks-user.yaml +++ b/ceph/templates/job-ks-user.yaml @@ -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 }} diff --git a/cinder/templates/job-ks-user.yaml b/cinder/templates/job-ks-user.yaml index a3a0348587..6bb47c5302 100644 --- a/cinder/templates/job-ks-user.yaml +++ b/cinder/templates/job-ks-user.yaml @@ -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 }} diff --git a/congress/templates/job-ks-user.yaml b/congress/templates/job-ks-user.yaml index 04eea44ce1..eb34d21fad 100644 --- a/congress/templates/job-ks-user.yaml +++ b/congress/templates/job-ks-user.yaml @@ -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 }} diff --git a/glance/templates/job-ks-user.yaml b/glance/templates/job-ks-user.yaml index 2c6b024dc5..bdb53fcea0 100644 --- a/glance/templates/job-ks-user.yaml +++ b/glance/templates/job-ks-user.yaml @@ -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 }} diff --git a/gnocchi/templates/job-ks-user.yaml b/gnocchi/templates/job-ks-user.yaml index 804cf9a306..843a2e85b6 100644 --- a/gnocchi/templates/job-ks-user.yaml +++ b/gnocchi/templates/job-ks-user.yaml @@ -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 }} diff --git a/heat/templates/job-ks-user-trustee.yaml b/heat/templates/job-ks-user-trustee.yaml index 1741bbd7db..0af10b5071 100644 --- a/heat/templates/job-ks-user-trustee.yaml +++ b/heat/templates/job-ks-user-trustee.yaml @@ -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 }} diff --git a/heat/templates/job-ks-user.yaml b/heat/templates/job-ks-user.yaml index 5a057a1a0f..3b431f6bfb 100644 --- a/heat/templates/job-ks-user.yaml +++ b/heat/templates/job-ks-user.yaml @@ -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 }} diff --git a/helm-toolkit/templates/manifests/_job-ks-user.yaml.tpl b/helm-toolkit/templates/manifests/_job-ks-user.yaml.tpl index 10cc601e10..f72d3753d1 100644 --- a/helm-toolkit/templates/manifests/_job-ks-user.yaml.tpl +++ b/helm-toolkit/templates/manifests/_job-ks-user.yaml.tpl @@ -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" }} diff --git a/magnum/templates/job-ks-user.yaml b/magnum/templates/job-ks-user.yaml index a091a0a757..13a285259f 100644 --- a/magnum/templates/job-ks-user.yaml +++ b/magnum/templates/job-ks-user.yaml @@ -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 }} diff --git a/mistral/templates/job-ks-user.yaml b/mistral/templates/job-ks-user.yaml index 389114a686..483f743008 100644 --- a/mistral/templates/job-ks-user.yaml +++ b/mistral/templates/job-ks-user.yaml @@ -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 }} diff --git a/neutron/templates/job-ks-user.yaml b/neutron/templates/job-ks-user.yaml index 48236ade3d..a78a8e078f 100644 --- a/neutron/templates/job-ks-user.yaml +++ b/neutron/templates/job-ks-user.yaml @@ -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 }} diff --git a/nova/templates/job-ks-user.yaml b/nova/templates/job-ks-user.yaml index a722cf2227..d14f1dffc9 100644 --- a/nova/templates/job-ks-user.yaml +++ b/nova/templates/job-ks-user.yaml @@ -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 }} diff --git a/rally/templates/job-ks-user.yaml b/rally/templates/job-ks-user.yaml index ddba1e92c2..5c5cd7e951 100644 --- a/rally/templates/job-ks-user.yaml +++ b/rally/templates/job-ks-user.yaml @@ -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 }} diff --git a/senlin/templates/job-ks-user.yaml b/senlin/templates/job-ks-user.yaml index 4c64ba3f36..8f4decb510 100644 --- a/senlin/templates/job-ks-user.yaml +++ b/senlin/templates/job-ks-user.yaml @@ -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 }}