From 75d3cb659f9fadb29b759eb28ea79ebb6451e47b Mon Sep 17 00:00:00 2001
From: portdirect <harbor@harbors-MacBook-Pro.local>
Date: Mon, 9 Jan 2017 00:26:48 +0000
Subject: [PATCH] Heat rebase against current master

---
 Makefile                                      | 21 ++++----
 common/templates/_endpoints.tpl               | 52 +++++++++----------
 ...nv.yaml => secret-keystone-admin.env.yaml} |  0
 ...ml => secret-keystone-stack-user.env.yaml} |  0
 ....yaml => secret-keystone-trustee.env.yaml} |  0
 ...env.yaml => secret-keystone-user.env.yaml} |  0
 6 files changed, 34 insertions(+), 39 deletions(-)
 rename heat/templates/{configmap-keystone-admin.env.yaml => secret-keystone-admin.env.yaml} (100%)
 rename heat/templates/{configmap-keystone-stack-user.env.yaml => secret-keystone-stack-user.env.yaml} (100%)
 rename heat/templates/{configmap-keystone-trustee.env.yaml => secret-keystone-trustee.env.yaml} (100%)
 rename heat/templates/{configmap-keystone-user.env.yaml => secret-keystone-user.env.yaml} (100%)

diff --git a/Makefile b/Makefile
index d7345126e3..e3c08d22c4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,12 @@
-.PHONY: ceph bootstrap mariadb keystone heat memcached rabbitmq common openstack all clean
+.PHONY: ceph bootstrap mariadb keystone memcached rabbitmq common openstack neutron heat maas all clean
 
 B64_DIRS := common/secrets
 B64_EXCLUDE := $(wildcard common/secrets/*.b64)
 
-CHARTS := ceph mariadb rabbitmq GLANCE memcached keystone glance horizon heat openstack
+CHARTS := ceph mariadb rabbitmq GLANCE memcached keystone glance horizon neutron heat maas openstack
 COMMON_TPL := common/templates/_globals.tpl
 
-all: common ceph bootstrap mariadb rabbitmq memcached keystone glance horizon heat openstack
+all: common ceph bootstrap mariadb rabbitmq memcached keystone glance horizon neutron heat maas openstack
 
 common: build-common
 
@@ -19,14 +19,18 @@ mariadb: build-mariadb
 
 keystone: build-keystone
 
-heat: build-heat
-
 horizon: build-horizon
 
 rabbitmq: build-rabbitmq
 
 glance: build-glance
 
+neutron: build-neutron
+
+heat: build-heat
+
+maas: build-maas
+
 memcached: build-memcached
 
 openstack: build-openstack
@@ -42,10 +46,3 @@ build-%:
 	if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
 	helm lint $*
 	helm package $*
-
-## this is required for some charts which cannot pass a lint, namely
-## those which use .Release.Namespace in a default pipe capacity
-#nolint-build-%:
-#       if [ -f $*/Makefile ]; then make -C $*; fi
-#       if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
-#       helm package $*
diff --git a/common/templates/_endpoints.tpl b/common/templates/_endpoints.tpl
index 5f1be74867..fe0a7d1888 100644
--- a/common/templates/_endpoints.tpl
+++ b/common/templates/_endpoints.tpl
@@ -2,32 +2,6 @@
 # endpoints
 #-----------------------------------------
 
-# this function returns the endpoint uri for a service, it takes an tuple
-# input in ther form: service-name, endpoint-class, port-name. eg:
-# { tuple "heat" "public" "api" . | include "endpoint_addr_lookup" }
-# will return the appropriate URI
-
-{{- define "endpoint_addr_lookup" -}}
-{{- $name := index . 0 -}}
-{{- $endpoint := index . 1 -}}
-{{- $port := index . 2 -}}
-{{- $context := index . 3 -}}
-{{- $nameNorm := $name | replace "-" "_" }}
-{{- $endpointMap := index $context.Values.endpoints $nameNorm }}
-{{- $endpointScheme := index $endpointMap "scheme" }}
-{{- $endpointPath := index $endpointMap "path" }}
-{{- $fqdn := $context.Release.Namespace -}}
-{{- if $context.Values.endpoints.fqdn -}}
-{{- $fqdn := $context.Values.endpoints.fqdn -}}
-{{- end -}}
-{{- with $endpointMap -}}
-{{- $endpointHost := index .hosts $endpoint | default .hosts.default}}
-{{- $endpointPort := index .port $port }}
-{{- printf "%s://%s.%s:%1.f%s" $endpointScheme $endpointHost $fqdn $endpointPort $endpointPath  | quote -}}
-{{- end -}}
-{{- end -}}
-
-
 # this should be a generic function leveraging a tuple
 # for input, e.g. { endpoint keystone internal . }
 # however, constructing this appears to be a
@@ -113,6 +87,31 @@
 {{- end -}}
 {{- end -}}
 
+# this function returns the endpoint uri for a service, it takes an tuple
+# input in the form: service-name, endpoint-class, port-name. eg:
+# { tuple "heat" "public" "api" . | include "endpoint_addr_lookup" }
+# will return the appropriate URI. Once merged this should phase out the above.
+
+{{- define "endpoint_addr_lookup" -}}
+{{- $name := index . 0 -}}
+{{- $endpoint := index . 1 -}}
+{{- $port := index . 2 -}}
+{{- $context := index . 3 -}}
+{{- $nameNorm := $name | replace "-" "_" }}
+{{- $endpointMap := index $context.Values.endpoints $nameNorm }}
+{{- $fqdn := $context.Release.Namespace -}}
+{{- if $context.Values.endpoints.fqdn -}}
+{{- $fqdn := $context.Values.endpoints.fqdn -}}
+{{- end -}}
+{{- with $endpointMap -}}
+{{- $endpointScheme := .scheme }}
+{{- $endpointHost := index .hosts $endpoint | default .hosts.default}}
+{{- $endpointPort := index .port $port }}
+{{- $endpointPath := .path }}
+{{- printf "%s://%s.%s:%1.f%s" $endpointScheme $endpointHost $fqdn $endpointPort $endpointPath  | quote -}}
+{{- end -}}
+{{- end -}}
+
 
 #-------------------------------
 # endpoint type lookup
@@ -132,7 +131,6 @@
 {{- $endpointType | quote -}}
 {{- end -}}
 
-
 #-------------------------------
 # kolla helpers
 #-------------------------------
diff --git a/heat/templates/configmap-keystone-admin.env.yaml b/heat/templates/secret-keystone-admin.env.yaml
similarity index 100%
rename from heat/templates/configmap-keystone-admin.env.yaml
rename to heat/templates/secret-keystone-admin.env.yaml
diff --git a/heat/templates/configmap-keystone-stack-user.env.yaml b/heat/templates/secret-keystone-stack-user.env.yaml
similarity index 100%
rename from heat/templates/configmap-keystone-stack-user.env.yaml
rename to heat/templates/secret-keystone-stack-user.env.yaml
diff --git a/heat/templates/configmap-keystone-trustee.env.yaml b/heat/templates/secret-keystone-trustee.env.yaml
similarity index 100%
rename from heat/templates/configmap-keystone-trustee.env.yaml
rename to heat/templates/secret-keystone-trustee.env.yaml
diff --git a/heat/templates/configmap-keystone-user.env.yaml b/heat/templates/secret-keystone-user.env.yaml
similarity index 100%
rename from heat/templates/configmap-keystone-user.env.yaml
rename to heat/templates/secret-keystone-user.env.yaml