diff --git a/charts/showroom/files/index.html b/charts/showroom/files/index.html
index c177104..92a9c82 100644
--- a/charts/showroom/files/index.html
+++ b/charts/showroom/files/index.html
@@ -13,7 +13,7 @@
{{- else }}
-
+
{{- end }}
diff --git a/charts/showroom/templates/_helpers.tpl b/charts/showroom/templates/_helpers.tpl
index 2b57a2a..6ea225e 100644
--- a/charts/showroom/templates/_helpers.tpl
+++ b/charts/showroom/templates/_helpers.tpl
@@ -5,20 +5,36 @@
catalogItem: "{{ .Values.general.catalogItem | toString | lower }}"
guid: "{{ .Values.general.guid | toString | lower }}"
app: "showroom"
+{{- end -}}
+
+{{/*
+USE ONLY WHEN WE HAVE AGV COMPONENT NAME
+If there's not already a namespace, create a namespace name from namespacename-guid-catalogItem
+{{ define "showroom-deployer.namespace.name" }}
{{- end }}
+*/}}
{{/*
-Create a namespace name from namespacename-guid-catalogItem
+If there's not already a namespace, create a namespace name from namespacename-guid
*/}}
-{{- define "showroom-deployer.namespace.name" }} {{ .Values.general.namespace | toString | lower }}-{{ .Values.general.guid | toString | lower }}-{{ .Values.general.catalogItem | toString | lower }}
-{{- end }}
+{{ define "showroom-deployer.namespace.name" -}}
+{{ if .Values.namespace -}}
+{{ .Values.namespace | toString | lower -}}
+{{ else if not .Values.general.aVcomponentName -}}
+{{ .Values.general.namespace | toString | lower }}-{{ $.Values.general.guid | toString | lower -}}
+{{ else -}}
+{{ .Values.general.namespace | toString | lower }}-{{ $.Values.general.guid | toString | lower }}-{{ .Values.general.agVcomponentName | toString | lower -}}
+{{ end -}}
+{{ end -}}
{{/*
The HTML files need a differently scoped set of the same values as above,
used in the showroom-deployer.showroom.route template below.
+Add conditions for AgVcomponentName when it comes along.
*/}}
-{{- define "showroom-deployer.htmlnamespace.name" }}{{ .general.namespace | toString | lower }}-{{ .general.guid | toString | lower }}-{{ .general.catalogItem | toString | lower }}
-{{- end }}
+{{- define "showroom-deployer.htmlnamespace.name" }}
+{{- .general.namespace | toString | lower }}-{{ .general.guid | toString | lower }}
+{{- end -}}
{{/*
Create a showroom route for the HTML page
@@ -28,4 +44,4 @@ Create a showroom route for the HTML page
{{- $values := index . 1 -}}
{{- $tmpnamespace := include "showroom-deployer.htmlnamespace.name" $values -}}
{{- printf "https://showroom-proxy-%s.%s/%s" $tmpnamespace $values.deployer.domain $service }}
-{{- end }}
+{{- end -}}
diff --git a/charts/showroom/templates/content/configmap.yaml b/charts/showroom/templates/content/configmap.yaml
index 9a4a3d1..b3c63fa 100644
--- a/charts/showroom/templates/content/configmap.yaml
+++ b/charts/showroom/templates/content/configmap.yaml
@@ -4,7 +4,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.content.userdataName }}
- namespace: {{- template "showroom-deployer.namespace.name" . }}
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
data:
user_data.yml: |
{{ .Values.content.user_data | indent 4 }}
diff --git a/charts/showroom/templates/content/deployment.yaml b/charts/showroom/templates/content/deployment.yaml
index 1ced0e3..1a53d19 100644
--- a/charts/showroom/templates/content/deployment.yaml
+++ b/charts/showroom/templates/content/deployment.yaml
@@ -4,7 +4,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: showroom-content
- namespace: {{- template "showroom-deployer.namespace.name" . }}
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
spec:
replicas: 1
selector:
diff --git a/charts/showroom/templates/content/service.yaml b/charts/showroom/templates/content/service.yaml
index ce626e0..2a6d9f4 100644
--- a/charts/showroom/templates/content/service.yaml
+++ b/charts/showroom/templates/content/service.yaml
@@ -4,7 +4,7 @@ apiVersion: v1
kind: Service
metadata:
name: showroom-content
- namespace: {{- template "showroom-deployer.namespace.name" . }}
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
spec:
type: ClusterIP
ports:
diff --git a/charts/showroom/templates/home/configmap.yaml b/charts/showroom/templates/home/configmap.yaml
index 554ac63..996d8e4 100644
--- a/charts/showroom/templates/home/configmap.yaml
+++ b/charts/showroom/templates/home/configmap.yaml
@@ -3,6 +3,6 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: showroom-html
- namespace: {{- template "showroom-deployer.namespace.name" . }}
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
data:
{{ tpl ((.Files.Glob "files/*").AsConfig) . | indent 2 }}
diff --git a/charts/showroom/templates/home/deployment.yaml b/charts/showroom/templates/home/deployment.yaml
index 2637686..1c16b10 100644
--- a/charts/showroom/templates/home/deployment.yaml
+++ b/charts/showroom/templates/home/deployment.yaml
@@ -3,7 +3,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: showroom
- namespace: {{- template "showroom-deployer.namespace.name" . }}
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
spec:
replicas: 1
selector:
diff --git a/charts/showroom/templates/home/service.yaml b/charts/showroom/templates/home/service.yaml
index 04a1026..375a72f 100644
--- a/charts/showroom/templates/home/service.yaml
+++ b/charts/showroom/templates/home/service.yaml
@@ -3,7 +3,7 @@ apiVersion: v1
kind: Service
metadata:
name: showroom
- namespace: {{- template "showroom-deployer.namespace.name" . }}
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
spec:
type: ClusterIP
ports:
diff --git a/charts/showroom/templates/namespace.yaml b/charts/showroom/templates/namespace.yaml
index 6e91a4d..87754fe 100644
--- a/charts/showroom/templates/namespace.yaml
+++ b/charts/showroom/templates/namespace.yaml
@@ -2,7 +2,7 @@
apiVersion: v1
kind: Namespace
metadata:
- name: {{- template "showroom-deployer.namespace.name" . }}
+ name: {{ template "showroom-deployer.namespace.name" . }}
annotations:
openshift.io/display-name: "Showroom Deployer"
openshift.io/description: "Showroom namespace description."
diff --git a/charts/showroom/templates/proxy/nginx/configmap.yaml b/charts/showroom/templates/proxy/nginx/configmap.yaml
index 2032029..c941a19 100644
--- a/charts/showroom/templates/proxy/nginx/configmap.yaml
+++ b/charts/showroom/templates/proxy/nginx/configmap.yaml
@@ -1,3 +1,8 @@
+kind: ConfigMap
+metadata:
+ creationTimestamp: null
+ name: showroom-proxy
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
apiVersion: v1
data:
nginx.conf: |
@@ -84,9 +89,3 @@ data:
}
}
-kind: ConfigMap
-metadata:
- creationTimestamp: null
- name: showroom-proxy
- # namespace: {{- template "showroom-deployer.namespace.name" . }}
- namespace: {{- template "showroom-deployer.namespace.name" . }}
diff --git a/charts/showroom/templates/proxy/nginx/deployment.yaml b/charts/showroom/templates/proxy/nginx/deployment.yaml
index 4e5fc2c..7815186 100644
--- a/charts/showroom/templates/proxy/nginx/deployment.yaml
+++ b/charts/showroom/templates/proxy/nginx/deployment.yaml
@@ -3,7 +3,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: showroom-proxy
- namespace: {{- template "showroom-deployer.namespace.name" . }}
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
labels:
app.kubernetes.io/name: showroom-proxy
spec:
diff --git a/charts/showroom/templates/proxy/nginx/route.yaml b/charts/showroom/templates/proxy/nginx/route.yaml
index a04a004..a1a2251 100644
--- a/charts/showroom/templates/proxy/nginx/route.yaml
+++ b/charts/showroom/templates/proxy/nginx/route.yaml
@@ -2,10 +2,8 @@
apiVersion: route.openshift.io/v1
kind: Route
metadata:
- #name: showroom-proxy
name: showroom-proxy
- namespace: {{- template "showroom-deployer.namespace.name" . }}
- #namespace: {{- template "showroom-deployer.namespace.name" . }}
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
labels:
app.kubernetes.io/name: showroom-proxy
spec:
diff --git a/charts/showroom/templates/proxy/nginx/service.yaml b/charts/showroom/templates/proxy/nginx/service.yaml
index e209c0f..0e36cb6 100644
--- a/charts/showroom/templates/proxy/nginx/service.yaml
+++ b/charts/showroom/templates/proxy/nginx/service.yaml
@@ -3,7 +3,7 @@ apiVersion: v1
kind: Service
metadata:
name: showroom-proxy
- namespace: {{- template "showroom-deployer.namespace.name" . }}
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
spec:
type: ClusterIP
ports:
diff --git a/charts/showroom/templates/terminal/deployment.yaml b/charts/showroom/templates/terminal/deployment.yaml
index 53fac0a..38691ad 100644
--- a/charts/showroom/templates/terminal/deployment.yaml
+++ b/charts/showroom/templates/terminal/deployment.yaml
@@ -2,8 +2,8 @@
apiVersion: apps/v1
kind: Deployment
metadata:
- name: terminal
- namespace: {{- template "showroom-deployer.namespace.name" . }}
+ name: showroom-terminal
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
spec:
replicas: 1
selector:
diff --git a/charts/showroom/templates/terminal/rbac.yaml b/charts/showroom/templates/terminal/rbac.yaml
index ff38c89..6eb9ce2 100644
--- a/charts/showroom/templates/terminal/rbac.yaml
+++ b/charts/showroom/templates/terminal/rbac.yaml
@@ -3,9 +3,9 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: edit-{{ .Values.terminal.serviceAccount }}
- namespace: {{- template "showroom-deployer.namespace.name" . }}
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
labels:
- app.kubernetes.io/instance: {{- template "showroom-deployer.namespace.name" . }}
+ app.kubernetes.io/instance: {{ template "showroom-deployer.namespace.name" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
@@ -13,4 +13,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ .Values.terminal.serviceAccount }}
- namespace: {{- template "showroom-deployer.namespace.name" . }}
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
diff --git a/charts/showroom/templates/terminal/service.yaml b/charts/showroom/templates/terminal/service.yaml
index 9776aa9..5f8bdf6 100644
--- a/charts/showroom/templates/terminal/service.yaml
+++ b/charts/showroom/templates/terminal/service.yaml
@@ -3,7 +3,7 @@ apiVersion: v1
kind: Service
metadata:
name: terminal
- namespace: {{- template "showroom-deployer.namespace.name" . }}
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
spec:
type: ClusterIP
ports:
diff --git a/charts/showroom/templates/terminal/serviceaccount.yaml b/charts/showroom/templates/terminal/serviceaccount.yaml
index a9e0806..1c6b67b 100644
--- a/charts/showroom/templates/terminal/serviceaccount.yaml
+++ b/charts/showroom/templates/terminal/serviceaccount.yaml
@@ -3,4 +3,4 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.terminal.serviceAccount }}
- namespace: {{- template "showroom-deployer.namespace.name" . }}
+ namespace: {{ template "showroom-deployer.namespace.name" . }}
diff --git a/charts/showroom/values.yaml b/charts/showroom/values.yaml
index 637b261..8c383f4 100644
--- a/charts/showroom/values.yaml
+++ b/charts/showroom/values.yaml
@@ -1,8 +1,8 @@
+---
# Default values for showroom.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
-
general:
guid: nnnn
namespace: showroom