Merge "Convert TOSCA loader from a Deployment to a Job"
diff --git a/xos-profiles/base-openstack/templates/tosca-deployment.yaml b/xos-profiles/base-openstack/templates/tosca-job.yaml
similarity index 89%
rename from xos-profiles/base-openstack/templates/tosca-deployment.yaml
rename to xos-profiles/base-openstack/templates/tosca-job.yaml
index a4392a9..f57b297 100644
--- a/xos-profiles/base-openstack/templates/tosca-deployment.yaml
+++ b/xos-profiles/base-openstack/templates/tosca-job.yaml
@@ -14,8 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-apiVersion: apps/v1beta2
-kind: Deployment
+apiVersion: batch/v1
+kind: Job
 metadata:
   name: {{ template "base-openstack.fullname" . }}-tosca-loader
   labels:
@@ -24,11 +24,6 @@
     release: {{ .Release.Name }}
     heritage: {{ .Release.Service }}
 spec:
-  replicas: {{ .Values.replicaCount }}
-  selector:
-    matchLabels:
-      app: {{ template "base-openstack.name" . }}
-      release: {{ .Release.Name }}
   template:
     metadata:
       labels:
@@ -37,6 +32,7 @@
       annotations:
         checksum/config: {{ include (print $.Template.BasePath "/tosca-configmap.yaml") . | sha256sum }}
     spec:
+      restartPolicy: Never
       containers:
         - name: {{ .Chart.Name }}-tosca-loader
           image: {{ .Values.httpieImage | quote }}
@@ -51,7 +47,6 @@
                 http --check-status --ignore-stdin POST http://xos-tosca:$XOS_TOSCA_SERVICE_PORT/run xos-username:{{ .Values.xosAdminUser }} xos-password:{{ .Values.xosAdminPassword }} @$recipe || exit 1
                 echo ''
               done
-              sleep 3600
           volumeMounts:
             - name: base-openstack-tosca
               mountPath: /opt/tosca
diff --git a/xos-profiles/rcord-lite/templates/tosca-deployment.yaml b/xos-profiles/rcord-lite/templates/tosca-job.yaml
similarity index 89%
rename from xos-profiles/rcord-lite/templates/tosca-deployment.yaml
rename to xos-profiles/rcord-lite/templates/tosca-job.yaml
index c5a0f71..5918716 100644
--- a/xos-profiles/rcord-lite/templates/tosca-deployment.yaml
+++ b/xos-profiles/rcord-lite/templates/tosca-job.yaml
@@ -14,8 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-apiVersion: apps/v1beta2
-kind: Deployment
+apiVersion: batch/v1
+kind: Job
 metadata:
   name: {{ template "rcord-lite.fullname" . }}-tosca-loader
   labels:
@@ -24,11 +24,6 @@
     release: {{ .Release.Name }}
     heritage: {{ .Release.Service }}
 spec:
-  replicas: {{ .Values.replicaCount }}
-  selector:
-    matchLabels:
-      app: {{ template "rcord-lite.name" . }}
-      release: {{ .Release.Name }}
   template:
     metadata:
       labels:
@@ -37,6 +32,7 @@
       annotations:
         checksum/config: {{ include (print $.Template.BasePath "/tosca-configmap.yaml") . | sha256sum }}
     spec:
+      restartPolicy: Never
       containers:
         - name: {{ .Chart.Name }}-tosca-loader
           image: {{ .Values.httpieImage | quote }}
@@ -51,7 +47,6 @@
                 http --check-status --ignore-stdin POST http://xos-tosca:$XOS_TOSCA_SERVICE_PORT/run xos-username:{{ .Values.xosAdminUser }} xos-password:{{ .Values.xosAdminPassword }} @$recipe || exit 1
                 echo ''
               done
-              sleep 3600
           volumeMounts:
             - name: rcord-lite-tosca
               mountPath: /opt/tosca