Merge "cmd-exec had a merge issue from elalto..."
authorDan Timoney <dtimoney@att.com>
Mon, 20 Apr 2020 12:28:01 +0000 (12:28 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 20 Apr 2020 12:28:01 +0000 (12:28 +0000)
ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt
ms/command-executor/src/main/docker/Dockerfile
ms/py-executor/docker/Dockerfile

index f55fee0..48ca912 100644 (file)
@@ -42,6 +42,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile
 import org.onap.ccsdk.cds.controllerblueprints.core.deleteNBDir
 import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
 import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType
+import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition
 import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService
 import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintEnhancerService
 import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintCompileCache
@@ -121,17 +122,29 @@ open class BluePrintModelHandler(
         workFlowData.inputs = workFlow.inputs
         workFlowData.outputs = workFlow.outputs
 
-        for ((k, v) in workFlow.inputs!!) {
-            addDataType(v.type, blueprintContext, wfRes)
+        if (workFlow.inputs != null) {
+            for ((k, v) in workFlow.inputs!!) {
+                addPropertyInfo(v, blueprintContext, wfRes)
+            }
         }
 
-        for ((k, v) in workFlow.outputs!!) {
-            addDataType(v.type, blueprintContext, wfRes)
+        if (workFlow.outputs != null) {
+            for ((k, v) in workFlow.outputs!!) {
+                addPropertyInfo(v, blueprintContext, wfRes)
+            }
         }
+
         wfRes.workFlowData = workFlowData
         return wfRes
     }
 
+    private fun addPropertyInfo(prop: PropertyDefinition, ctx: BluePrintContext, res: WorkFlowSpecResponse) {
+        addDataType(prop.type, ctx, res)
+        if (prop.entrySchema != null && prop.entrySchema!!.type != null) {
+            addDataType(prop.entrySchema!!.type, ctx, res)
+        }
+    }
+
     private fun addDataType(name: String, ctx: BluePrintContext, res: WorkFlowSpecResponse) {
         var data = ctx.dataTypeByName(name)
         if (data != null) {
@@ -141,8 +154,10 @@ open class BluePrintModelHandler(
     }
 
     private fun addParentDataType(data: DataType, ctx: BluePrintContext, res: WorkFlowSpecResponse) {
-        for ((k, v) in data.properties!!) {
-            addDataType(v.type, ctx, res)
+        if (data.properties != null) {
+            for ((k, v) in data.properties!!) {
+                addPropertyInfo(v, ctx, res)
+            }
         }
     }
 
index 70cf943..c381260 100644 (file)
@@ -5,10 +5,13 @@ RUN python -m pip install --upgrade pip
 RUN pip install grpcio==${GRPC_PYTHON_VERSION} grpcio-tools==${GRPC_PYTHON_VERSION}
 RUN pip install virtualenv==16.7.9
 
+RUN groupadd -r onap && useradd -r -g onap onap
+
 COPY start.sh /opt/app/onap/start.sh
 RUN chmod u+x /opt/app/onap/start.sh
 
 RUN mkdir -p /opt/app/onap/logs/ && touch /opt/app/onap/logs/application.log
+RUN chown onap:onap /opt -R
 
 COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz
 RUN tar -xzf /source.tar.gz -C /tmp \
@@ -17,5 +20,5 @@ RUN tar -xzf /source.tar.gz -C /tmp \
  && rm -rf /tmp/@project.build.finalName@
 
 VOLUME /opt/app/onap/blueprints/deploy/
-
+USER onap
 ENTRYPOINT /opt/app/onap/start.sh
index 043e15d..bb1b0f7 100644 (file)
@@ -1,5 +1,7 @@
 FROM python:3.7-slim
 
+RUN groupadd -r onap && useradd -r -g onap onap
+
 RUN mkdir -p /opt/app/onap/logs/ && touch /opt/app/onap/logs/application.log
 
 COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz
@@ -10,6 +12,8 @@ RUN tar -xzf /source.tar.gz -C /tmp \
 
 RUN pip install --no-cache-dir -r /opt/app/onap/python/requirements/docker.txt
 
-VOLUME /opt/app/onap/blueprints/deploy/
+RUN chown onap:onap /opt -R
 
+VOLUME /opt/app/onap/blueprints/deploy/
+USER onap
 ENTRYPOINT /opt/app/onap/python/start.sh