[CLAMP] Uses new tpls for repos / images

This commit makes clamp chart to use the new generator for repositories and
images.

Issue-ID: OOM-2364
Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Change-Id: I5e266d3adaecc1cb65c35732c2d174dd159b8a03
diff --git a/kubernetes/clamp/components/clamp-backend/requirements.yaml b/kubernetes/clamp/components/clamp-backend/requirements.yaml
index 08708fb..5b041a5 100644
--- a/kubernetes/clamp/components/clamp-backend/requirements.yaml
+++ b/kubernetes/clamp/components/clamp-backend/requirements.yaml
@@ -16,4 +16,7 @@
 dependencies:
   - name: certInitializer
     version: ~6.x-0
+    repository: '@local'
+  - name: repositoryGenerator
+    version: ~6.x-0
     repository: '@local'
\ No newline at end of file
diff --git a/kubernetes/clamp/components/clamp-backend/templates/deployment.yaml b/kubernetes/clamp/components/clamp-backend/templates/deployment.yaml
index 1591efb..9153f9d 100644
--- a/kubernetes/clamp/components/clamp-backend/templates/deployment.yaml
+++ b/kubernetes/clamp/components/clamp-backend/templates/deployment.yaml
@@ -48,7 +48,7 @@
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
-        image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
+        image: {{ include "repositoryGenerator.image.readiness" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}-readiness
 {{ include "common.certInitializer.initContainer" . | indent 6 }}
@@ -57,7 +57,7 @@
         {{ if .Values.global.centralizedLoggingEnabled }}{{ include "common.log.sidecar" . | nindent 8 }}{{ end }}
         # main container
         - name: {{ include "common.name" . }}
-          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           command:
           - sh
diff --git a/kubernetes/clamp/components/clamp-backend/values.yaml b/kubernetes/clamp/components/clamp-backend/values.yaml
index 5e3102e..efd08ba 100644
--- a/kubernetes/clamp/components/clamp-backend/values.yaml
+++ b/kubernetes/clamp/components/clamp-backend/values.yaml
@@ -18,8 +18,6 @@
 #################################################################
 global: # global defaults
   nodePortPrefix: 302
-  repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ==
-  readinessImage: onap/oom/readiness:3.0.1
   persistence: {}
   centralizedLoggingEnabled: true
   #AAF service
@@ -65,7 +63,6 @@
 flavor: small
 
 # application image
-repository: nexus3.onap.org:10001
 image: onap/clamp-backend:5.1.5
 pullPolicy: Always
 
diff --git a/kubernetes/clamp/components/clamp-dash-es/requirements.yaml b/kubernetes/clamp/components/clamp-dash-es/requirements.yaml
index 317d5b5..c388db3 100644
--- a/kubernetes/clamp/components/clamp-dash-es/requirements.yaml
+++ b/kubernetes/clamp/components/clamp-dash-es/requirements.yaml
@@ -19,4 +19,7 @@
     repository: '@local'
   - name: certInitializer
     version: ~6.x-0
+    repository: '@local'
+  - name: repositoryGenerator
+    version: ~6.x-0
     repository: '@local'
\ No newline at end of file
diff --git a/kubernetes/clamp/components/clamp-dash-es/templates/deployment.yaml b/kubernetes/clamp/components/clamp-dash-es/templates/deployment.yaml
index dcf011d..d7aa77c 100644
--- a/kubernetes/clamp/components/clamp-dash-es/templates/deployment.yaml
+++ b/kubernetes/clamp/components/clamp-dash-es/templates/deployment.yaml
@@ -53,7 +53,7 @@
               fieldPath: metadata.namespace
         securityContext:
           privileged: true
-        image: {{ .Values.global.busyboxRepository | default .Values.busyboxRepository }}/{{ .Values.busyboxImage }}
+        image: {{ include "repositoryGenerator.image.busybox" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: init-sysctl
         volumeMounts:
@@ -64,7 +64,7 @@
 {{ include "common.certInitializer.initContainer" . | indent 6 }}
       containers:
         - name: {{ include "common.name" . }}
-          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           {{- if .Values.global.aafEnabled }}
           command:
diff --git a/kubernetes/clamp/components/clamp-dash-es/values.yaml b/kubernetes/clamp/components/clamp-dash-es/values.yaml
index ed53c0c..1e2ae47 100644
--- a/kubernetes/clamp/components/clamp-dash-es/values.yaml
+++ b/kubernetes/clamp/components/clamp-dash-es/values.yaml
@@ -18,7 +18,6 @@
 #################################################################
 global:
   nodePortPrefix: 302
-  repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ==
   persistence: {}
   centralizedLoggingEnabled: true
   #AAF service
@@ -63,13 +62,7 @@
 #################################################################
 # Application configuration defaults.
 #################################################################
-
-# BusyBox image
-busyboxRepository: docker.io
-busyboxImage: library/busybox:latest
-
 # application image
-repository: nexus3.onap.org:10001
 image: onap/clamp-dashboard-elasticsearch:5.0.4
 pullPolicy: Always
 
diff --git a/kubernetes/clamp/components/clamp-dash-kibana/requirements.yaml b/kubernetes/clamp/components/clamp-dash-kibana/requirements.yaml
index 317d5b5..c388db3 100644
--- a/kubernetes/clamp/components/clamp-dash-kibana/requirements.yaml
+++ b/kubernetes/clamp/components/clamp-dash-kibana/requirements.yaml
@@ -19,4 +19,7 @@
     repository: '@local'
   - name: certInitializer
     version: ~6.x-0
+    repository: '@local'
+  - name: repositoryGenerator
+    version: ~6.x-0
     repository: '@local'
\ No newline at end of file
diff --git a/kubernetes/clamp/components/clamp-dash-kibana/templates/deployment.yaml b/kubernetes/clamp/components/clamp-dash-kibana/templates/deployment.yaml
index 99f0079..8cb95cd 100644
--- a/kubernetes/clamp/components/clamp-dash-kibana/templates/deployment.yaml
+++ b/kubernetes/clamp/components/clamp-dash-kibana/templates/deployment.yaml
@@ -48,13 +48,13 @@
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
-        image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
+        image: {{ include "repositoryGenerator.image.readiness" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}-readiness
 {{ include "common.certInitializer.initContainer" . | indent 6 }}
       containers:
         - name: {{ include "common.name" . }}
-          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           ports:
           - containerPort: {{ .Values.service.internalPort }}
diff --git a/kubernetes/clamp/components/clamp-dash-kibana/values.yaml b/kubernetes/clamp/components/clamp-dash-kibana/values.yaml
index a5d11c7..9b5f1fc 100644
--- a/kubernetes/clamp/components/clamp-dash-kibana/values.yaml
+++ b/kubernetes/clamp/components/clamp-dash-kibana/values.yaml
@@ -18,8 +18,6 @@
 #################################################################
 global:
   nodePortPrefix: 302
-  repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ==
-  readinessImage: onap/oom/readiness:3.0.1
   persistence: {}
   centralizedLoggingEnabled: true
   #AAF service
@@ -64,13 +62,7 @@
 #################################################################
 # Application configuration defaults.
 #################################################################
-
-# BusyBox image
-busyboxRepository: docker.io
-busyboxImage: library/busybox:latest
-
 # application image
-repository: nexus3.onap.org:10001
 image: onap/clamp-dashboard-kibana:5.0.4
 pullPolicy: Always
 
diff --git a/kubernetes/clamp/components/clamp-dash-logstash/requirements.yaml b/kubernetes/clamp/components/clamp-dash-logstash/requirements.yaml
index 317d5b5..c388db3 100644
--- a/kubernetes/clamp/components/clamp-dash-logstash/requirements.yaml
+++ b/kubernetes/clamp/components/clamp-dash-logstash/requirements.yaml
@@ -19,4 +19,7 @@
     repository: '@local'
   - name: certInitializer
     version: ~6.x-0
+    repository: '@local'
+  - name: repositoryGenerator
+    version: ~6.x-0
     repository: '@local'
\ No newline at end of file
diff --git a/kubernetes/clamp/components/clamp-dash-logstash/templates/deployment.yaml b/kubernetes/clamp/components/clamp-dash-logstash/templates/deployment.yaml
index 9fd4c40..f098338 100644
--- a/kubernetes/clamp/components/clamp-dash-logstash/templates/deployment.yaml
+++ b/kubernetes/clamp/components/clamp-dash-logstash/templates/deployment.yaml
@@ -48,13 +48,13 @@
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
-        image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
+        image: {{ include "repositoryGenerator.image.readiness" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}-readiness
 {{ include "common.certInitializer.initContainer" . | indent 6 }}
       containers:
         - name: {{ include "common.name" . }}
-          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           env:
           - name: dmaap_consumer_group
diff --git a/kubernetes/clamp/components/clamp-dash-logstash/values.yaml b/kubernetes/clamp/components/clamp-dash-logstash/values.yaml
index 2b3c9f1..9aab3af 100644
--- a/kubernetes/clamp/components/clamp-dash-logstash/values.yaml
+++ b/kubernetes/clamp/components/clamp-dash-logstash/values.yaml
@@ -18,8 +18,6 @@
 #################################################################
 global:
   nodePortPrefix: 302
-  repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ==
-  readinessImage: onap/oom/readiness:3.0.1
   persistence: {}
   centralizedLoggingEnabled: true
   #AAF service
@@ -66,7 +64,6 @@
 #################################################################
 
 # application image
-repository: nexus3.onap.org:10001
 image: onap/clamp-dashboard-logstash:5.0.4
 pullPolicy: Always
 
diff --git a/kubernetes/clamp/components/clamp-mariadb/requirements.yaml b/kubernetes/clamp/components/clamp-mariadb/requirements.yaml
index 9b96d0c..b5d66f3 100644
--- a/kubernetes/clamp/components/clamp-mariadb/requirements.yaml
+++ b/kubernetes/clamp/components/clamp-mariadb/requirements.yaml
@@ -15,4 +15,7 @@
 dependencies:
   - name: common
     version: ~6.x-0
+    repository: '@local'
+  - name: repositoryGenerator
+    version: ~6.x-0
     repository: '@local'
\ No newline at end of file
diff --git a/kubernetes/clamp/components/clamp-mariadb/templates/deployment.yaml b/kubernetes/clamp/components/clamp-mariadb/templates/deployment.yaml
index 6d30b36..8ddf584 100644
--- a/kubernetes/clamp/components/clamp-mariadb/templates/deployment.yaml
+++ b/kubernetes/clamp/components/clamp-mariadb/templates/deployment.yaml
@@ -38,7 +38,7 @@
     spec:
       containers:
         - name: {{ include "common.name" .  }}
-          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           ports:
           - containerPort: {{ .Values.service.internalPort }}
diff --git a/kubernetes/clamp/components/clamp-mariadb/values.yaml b/kubernetes/clamp/components/clamp-mariadb/values.yaml
index f9a31b6..60b2cfe 100644
--- a/kubernetes/clamp/components/clamp-mariadb/values.yaml
+++ b/kubernetes/clamp/components/clamp-mariadb/values.yaml
@@ -21,7 +21,6 @@
 
   persistence: {}
 # application image
-repository: docker.io
 image: mariadb:10.5.4
 pullPolicy: Always
 flavor: small