From 53990b4253a11b0ec80cec05a5f1fcd4d25bae01 Mon Sep 17 00:00:00 2001
From: prathamesh <prathamesh_morde@yahoo.ca>
Date: Tue, 3 Dec 2019 11:18:32 -0500
Subject: Pass error message in the exception when thrown from CDS-Adapter

Issue-ID: SO-2494
Signed-off-by: prathamesh <prathamesh_morde@yahoo.ca>
Change-Id: I1990ba00ab55ed08c7ba8c31e6fe8fbedb428e7e
---
 .../client/cds/AbstractCDSProcessingBBUtils.java   | 132 ++++++++++++---------
 1 file changed, 77 insertions(+), 55 deletions(-)

(limited to 'bpmn/MSOCommonBPMN/src/main')

diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
index 5498b5be31..9741d4b6c2 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java
@@ -24,7 +24,6 @@ package org.onap.so.client.cds;
 
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicReference;
 import org.camunda.bpm.engine.delegate.DelegateExecution;
 import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
 import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader;
@@ -51,28 +50,29 @@ import io.grpc.Status;
  *
  */
 @Component
-public class AbstractCDSProcessingBBUtils implements CDSProcessingListener {
+public class AbstractCDSProcessingBBUtils {
 
     private static final Logger logger = LoggerFactory.getLogger(AbstractCDSProcessingBBUtils.class);
 
     private static final String SUCCESS = "Success";
     private static final String FAILED = "Failed";
     private static final String PROCESSING = "Processing";
+    private static final String RESPONSE_PAYLOAD = "CDSResponsePayload";
+    private static final String CDS_STATUS = "CDSStatus";
+    private static final String EXEC_INPUT = "executionServiceInput";
+
 
     /**
      * indicate exception thrown.
      */
     private static final String EXCEPTION = "Exception";
 
-
-    private final AtomicReference<String> cdsResponse = new AtomicReference<>();
-
     @Autowired
     private ExceptionBuilder exceptionUtil;
 
     /**
      * Extracting data from execution object and building the ExecutionServiceInput Object
-     * 
+     *
      * @param execution DelegateExecution object
      */
     public void constructExecutionServiceInputObject(DelegateExecution execution) {
@@ -105,7 +105,7 @@ public class AbstractCDSProcessingBBUtils implements CDSProcessingListener {
                     ExecutionServiceInput.newBuilder().setCommonHeader(commonHeader)
                             .setActionIdentifiers(actionIdentifiers).setPayload(struct.build()).build();
 
-            execution.setVariable("executionServiceInput", executionServiceInput);
+            execution.setVariable(EXEC_INPUT, executionServiceInput);
 
         } catch (Exception ex) {
             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
@@ -114,7 +114,7 @@ public class AbstractCDSProcessingBBUtils implements CDSProcessingListener {
 
     /**
      * get the executionServiceInput object from execution and send a request to CDS Client and wait for TIMEOUT period
-     * 
+     *
      * @param execution DelegateExecution object
      */
     public void sendRequestToCDSClient(DelegateExecution execution) {
@@ -127,10 +127,11 @@ public class AbstractCDSProcessingBBUtils implements CDSProcessingListener {
                         "No RestProperty.CDSProperties implementation found on classpath, can't create client.");
             }
 
-            ExecutionServiceInput executionServiceInput =
-                    (ExecutionServiceInput) execution.getVariable("executionServiceInput");
+            ExecutionServiceInput executionServiceInput = (ExecutionServiceInput) execution.getVariable(EXEC_INPUT);
+
+            CDSResponse cdsResponse = new CDSResponse();
 
-            try (CDSProcessingClient cdsClient = new CDSProcessingClient(this)) {
+            try (CDSProcessingClient cdsClient = new CDSProcessingClient(new ResponseHandler(cdsResponse))) {
                 CountDownLatch countDownLatch = cdsClient.sendRequest(executionServiceInput);
                 countDownLatch.await(props.getTimeout(), TimeUnit.SECONDS);
             } catch (InterruptedException ex) {
@@ -138,61 +139,82 @@ public class AbstractCDSProcessingBBUtils implements CDSProcessingListener {
                 Thread.currentThread().interrupt();
             }
 
-            if (cdsResponse != null) {
-                String cdsResponseStatus = cdsResponse.get();
-                execution.setVariable("CDSStatus", cdsResponseStatus);
+            String cdsResponseStatus = cdsResponse.status;
+
+            /**
+             * throw CDS failed exception.
+             */
+            if (!cdsResponseStatus.equals(SUCCESS)) {
+                throw new BadResponseException("CDS call failed with status: " + cdsResponse.status
+                        + " and errorMessage: " + cdsResponse.errorMessage);
+            }
+
+            execution.setVariable(CDS_STATUS, cdsResponseStatus);
 
-                /**
-                 * throw CDS failed exception.
-                 */
-                if (cdsResponseStatus != SUCCESS) {
-                    throw new BadResponseException("CDS call failed with status: " + cdsResponseStatus);
-                }
+            if (cdsResponse.payload != null) {
+                String payload = JsonFormat.printer().print(cdsResponse.payload);
+                execution.setVariable(RESPONSE_PAYLOAD, payload);
             }
 
+
+
         } catch (Exception ex) {
             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
         }
     }
 
-    /**
-     * Get Response from CDS Client
-     * 
-     */
-    @Override
-    public void onMessage(ExecutionServiceOutput message) {
-        logger.info("Received notification from CDS: {}", message);
-        EventType eventType = message.getStatus().getEventType();
-
-        switch (eventType) {
-
-            case EVENT_COMPONENT_FAILURE:
-                // failed processing with failure
-                cdsResponse.set(FAILED);
-                break;
-            case EVENT_COMPONENT_PROCESSING:
-                // still processing
-                cdsResponse.set(PROCESSING);
-                break;
-            case EVENT_COMPONENT_EXECUTED:
-                // done with async processing
-                cdsResponse.set(SUCCESS);
-                break;
-            default:
-                cdsResponse.set(FAILED);
-                break;
+    private class ResponseHandler implements CDSProcessingListener {
+
+        private CDSResponse cdsResponse;
+
+        ResponseHandler(CDSResponse cdsResponse) {
+            this.cdsResponse = cdsResponse;
         }
 
-    }
+        /**
+         * Get Response from CDS Client
+         */
+        @Override
+        public void onMessage(ExecutionServiceOutput message) {
+            logger.info("Received notification from CDS: {}", message);
+            EventType eventType = message.getStatus().getEventType();
+
+            switch (eventType) {
+                case EVENT_COMPONENT_PROCESSING:
+                    cdsResponse.status = PROCESSING;
+                    break;
+                case EVENT_COMPONENT_EXECUTED:
+                    cdsResponse.status = SUCCESS;
+                    break;
+                default:
+                    cdsResponse.status = FAILED;
+                    cdsResponse.errorMessage = message.getStatus().getErrorMessage();
+                    break;
+            }
+            cdsResponse.payload = message.getPayload();
+        }
 
-    /**
-     * On error at CDS, log the error
-     */
-    @Override
-    public void onError(Throwable t) {
-        Status status = Status.fromThrowable(t);
-        logger.error("Failed processing blueprint {}", status, t);
-        cdsResponse.set(EXCEPTION);
+        /**
+         * On error at CDS, log the error
+         */
+        @Override
+        public void onError(Throwable t) {
+            Status status = Status.fromThrowable(t);
+            logger.error("Failed processing blueprint {}", status, t);
+            cdsResponse.status = EXCEPTION;
+        }
     }
 
+    private class CDSResponse {
+
+        String status;
+        String errorMessage;
+        Struct payload;
+
+        @Override
+        public String toString() {
+            return "CDSResponse{" + "status='" + status + '\'' + ", errorMessage='" + errorMessage + '\'' + ", payload="
+                    + payload + '}';
+        }
+    }
 }
-- 
cgit 

 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */</style><div class="highlight"><pre><span></span><span class="c1"># Copyright © 2018  AT&amp;T Intellectual Property.  All rights reserved.</span>
<span class="c1"># Modifications Copyright © 2018 Amdocs,Bell Canada</span>
<span class="c1">#</span>
<span class="c1"># Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
<span class="c1"># you may not use this file except in compliance with the License.</span>
<span class="c1"># You may obtain a copy of the License at</span>
<span class="c1">#</span>
<span class="c1">#       http://www.apache.org/licenses/LICENSE-2.0</span>
<span class="c1">#</span>
<span class="c1"># Unless required by applicable law or agreed to in writing, software</span>
<span class="c1"># distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
<span class="c1"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<span class="c1"># See the License for the specific language governing permissions and</span>
<span class="c1"># limitations under the License.</span>

<span class="l l-Scalar l-Scalar-Plain">apiVersion</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">extensions/v1beta1</span>
<span class="l l-Scalar l-Scalar-Plain">kind</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">Deployment</span>
<span class="l l-Scalar l-Scalar-Plain">metadata</span><span class="p p-Indicator">:</span>
  <span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">include &quot;common.fullname&quot; .</span> <span class="p p-Indicator">}}</span>
  <span class="l l-Scalar l-Scalar-Plain">namespace</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">include &quot;common.namespace&quot; .</span> <span class="p p-Indicator">}}</span>
  <span class="l l-Scalar l-Scalar-Plain">labels</span><span class="p p-Indicator">:</span>
    <span class="l l-Scalar l-Scalar-Plain">app</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">include &quot;common.name&quot; .</span> <span class="p p-Indicator">}}</span>
    <span class="l l-Scalar l-Scalar-Plain">chart</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Chart.Name</span> <span class="p p-Indicator">}}</span><span class="l l-Scalar l-Scalar-Plain">-{{ .Chart.Version | replace &quot;+&quot; &quot;_&quot; }}</span>
    <span class="l l-Scalar l-Scalar-Plain">release</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Release.Name</span> <span class="p p-Indicator">}}</span>
    <span class="l l-Scalar l-Scalar-Plain">heritage</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Release.Service</span> <span class="p p-Indicator">}}</span>
<span class="l l-Scalar l-Scalar-Plain">spec</span><span class="p p-Indicator">:</span>
  <span class="l l-Scalar l-Scalar-Plain">replicas</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Values.replicaCount</span> <span class="p p-Indicator">}}</span>
  <span class="l l-Scalar l-Scalar-Plain">template</span><span class="p p-Indicator">:</span>
    <span class="l l-Scalar l-Scalar-Plain">metadata</span><span class="p p-Indicator">:</span>
      <span class="l l-Scalar l-Scalar-Plain">labels</span><span class="p p-Indicator">:</span>
        <span class="l l-Scalar l-Scalar-Plain">app</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">include &quot;common.name&quot; .</span> <span class="p p-Indicator">}}</span>
        <span class="l l-Scalar l-Scalar-Plain">release</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Release.Name</span> <span class="p p-Indicator">}}</span>
    <span class="l l-Scalar l-Scalar-Plain">spec</span><span class="p p-Indicator">:</span>
      <span class="l l-Scalar l-Scalar-Plain">hostAliases</span><span class="p p-Indicator">:</span>
      <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">ip</span><span class="p p-Indicator">:</span> <span class="s">&quot;10.12.6.214&quot;</span>
        <span class="l l-Scalar l-Scalar-Plain">hostnames</span><span class="p p-Indicator">:</span>
        <span class="p p-Indicator">-</span> <span class="s">&quot;aaf-onap-test.osaaf.org&quot;</span>
      <span class="l l-Scalar l-Scalar-Plain">initContainers</span><span class="p p-Indicator">:</span>
      <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">command</span><span class="p p-Indicator">:</span>
        <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/root/ready.py</span>
        <span class="l l-Scalar l-Scalar-Plain">args</span><span class="p p-Indicator">:</span>
        <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">--container-name</span>
        <span class="p p-Indicator">-</span> <span class="p p-Indicator">{{</span> <span class="nv">.Values.postgres.nameOverride</span> <span class="p p-Indicator">}}</span>
        <span class="l l-Scalar l-Scalar-Plain">env</span><span class="p p-Indicator">:</span>
        <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">NAMESPACE</span>
          <span class="l l-Scalar l-Scalar-Plain">valueFrom</span><span class="p p-Indicator">:</span>
            <span class="l l-Scalar l-Scalar-Plain">fieldRef</span><span class="p p-Indicator">:</span>
              <span class="l l-Scalar l-Scalar-Plain">apiVersion</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">v1</span>
              <span class="l l-Scalar l-Scalar-Plain">fieldPath</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">metadata.namespace</span>
        <span class="l l-Scalar l-Scalar-Plain">image</span><span class="p p-Indicator">:</span> <span class="s">&quot;{{</span><span class="nv"> </span><span class="s">.Values.global.readinessRepository</span><span class="nv"> </span><span class="s">}}/{{</span><span class="nv"> </span><span class="s">.Values.global.readinessImage</span><span class="nv"> </span><span class="s">}}&quot;</span>
        <span class="l l-Scalar l-Scalar-Plain">imagePullPolicy</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Values.global.pullPolicy | default .Values.pullPolicy</span> <span class="p p-Indicator">}}</span>
        <span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">include &quot;common.name&quot; .</span> <span class="p p-Indicator">}}</span><span class="l l-Scalar l-Scalar-Plain">-readiness</span>
      <span class="l l-Scalar l-Scalar-Plain">containers</span><span class="p p-Indicator">:</span>
        <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">include &quot;common.name&quot; .</span> <span class="p p-Indicator">}}</span>
          <span class="l l-Scalar l-Scalar-Plain">image</span><span class="p p-Indicator">:</span> <span class="s">&quot;{{</span><span class="nv"> </span><span class="s">include</span><span class="nv"> </span><span class="s">&quot;</span><span class="l l-Scalar l-Scalar-Plain">common.repository&quot; . }}/{{ .Values.image }}&quot;</span>
          <span class="l l-Scalar l-Scalar-Plain">imagePullPolicy</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Values.global.pullPolicy | default .Values.pullPolicy</span> <span class="p p-Indicator">}}</span>
          <span class="l l-Scalar l-Scalar-Plain">ports</span><span class="p p-Indicator">:</span>
          <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">containerPort</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Values.service.internalPort</span> <span class="p p-Indicator">}}</span>
          <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">containerPort</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Values.service.internalPort2</span> <span class="p p-Indicator">}}</span>
          <span class="p p-Indicator">{{</span><span class="nv">if eq .Values.liveness.enabled true</span> <span class="p p-Indicator">}}</span>
          <span class="l l-Scalar l-Scalar-Plain">livenessProbe</span><span class="p p-Indicator">:</span>
            <span class="l l-Scalar l-Scalar-Plain">httpGet</span><span class="p p-Indicator">:</span>
              <span class="l l-Scalar l-Scalar-Plain">port</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Values.service.internalPort</span> <span class="p p-Indicator">}}</span>
              <span class="l l-Scalar l-Scalar-Plain">path</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">/webapi/info</span>
            <span class="l l-Scalar l-Scalar-Plain">initialDelaySeconds</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Values.liveness.initialDelaySeconds</span> <span class="p p-Indicator">}}</span>
            <span class="l l-Scalar l-Scalar-Plain">periodSeconds</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Values.liveness.periodSeconds</span> <span class="p p-Indicator">}}</span>
          <span class="l l-Scalar l-Scalar-Plain">readinessProbe</span><span class="p p-Indicator">:</span>
            <span class="l l-Scalar l-Scalar-Plain">httpGet</span><span class="p p-Indicator">:</span>
              <span class="l l-Scalar l-Scalar-Plain">host</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Values.dmaapMessageRouterService</span> <span class="p p-Indicator">}}</span>
              <span class="l l-Scalar l-Scalar-Plain">port</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">3904</span>
              <span class="l l-Scalar l-Scalar-Plain">path</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">/topics</span>
            <span class="l l-Scalar l-Scalar-Plain">initialDelaySeconds</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Values.readiness.initialDelaySeconds</span> <span class="p p-Indicator">}}</span>
            <span class="l l-Scalar l-Scalar-Plain">periodSeconds</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">.Values.readiness.periodSeconds</span> <span class="p p-Indicator">}}</span>
          <span class="p p-Indicator">{{</span> <span class="nv">end -</span><span class="p p-Indicator">}}</span>
          <span class="l l-Scalar l-Scalar-Plain">volumeMounts</span><span class="p p-Indicator">:</span>
          <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">mountPath</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">/etc/localtime</span>
            <span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">localtime</span>
            <span class="l l-Scalar l-Scalar-Plain">readOnly</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span>

<span class="c1"># NOTE: on the following several configMaps, careful to include / at end</span>
<span class="c1">#       since there may be more than one file in each mountPath</span>
          <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">include &quot;common.name&quot; .</span> <span class="p p-Indicator">}}</span><span class="l l-Scalar l-Scalar-Plain">-config</span>
            <span class="l l-Scalar l-Scalar-Plain">mountPath</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">/opt/app/config/conf/</span>

          <span class="l l-Scalar l-Scalar-Plain">resources</span><span class="p p-Indicator">:</span>
<span class="p p-Indicator">{{</span> <span class="nv">include &quot;common.resources&quot; . | indent 12</span> <span class="p p-Indicator">}}</span>
        <span class="p p-Indicator">{{</span><span class="nv">- if .Values.nodeSelector</span> <span class="p p-Indicator">}}</span>
        <span class="l l-Scalar l-Scalar-Plain">nodeSelector</span><span class="p p-Indicator">:</span>
<span class="p p-Indicator">{{</span> <span class="nv">toYaml .Values.nodeSelector | indent 10</span> <span class="p p-Indicator">}}</span>
        <span class="p p-Indicator">{{</span><span class="nv">- end -</span><span class="p p-Indicator">}}</span>
        <span class="p p-Indicator">{{</span><span class="nv">- if .Values.affinity</span> <span class="p p-Indicator">}}</span>
        <span class="l l-Scalar l-Scalar-Plain">affinity</span><span class="p p-Indicator">:</span>
<span class="p p-Indicator">{{</span> <span class="nv">toYaml .Values.affinity | indent 10</span> <span class="p p-Indicator">}}</span>
        <span class="p p-Indicator">{{</span><span class="nv">- end</span> <span class="p p-Indicator">}}</span>
      <span class="l l-Scalar l-Scalar-Plain">volumes</span><span class="p p-Indicator">:</span>
        <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">localtime</span>
          <span class="l l-Scalar l-Scalar-Plain">hostPath</span><span class="p p-Indicator">:</span>
            <span class="l l-Scalar l-Scalar-Plain">path</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">/etc/localtime</span>
        <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">include &quot;common.name&quot; .</span> <span class="p p-Indicator">}}</span><span class="l l-Scalar l-Scalar-Plain">-config</span>
          <span class="l l-Scalar l-Scalar-Plain">configMap</span><span class="p p-Indicator">:</span>
            <span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{{</span> <span class="nv">include &quot;common.fullname&quot; .</span> <span class="p p-Indicator">}}</span><span class="l l-Scalar l-Scalar-Plain">-config</span>
      <span class="l l-Scalar l-Scalar-Plain">imagePullSecrets</span><span class="p p-Indicator">:</span>
      <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="s">&quot;{{</span><span class="nv"> </span><span class="s">include</span><span class="nv"> </span><span class="s">&quot;</span><span class="l l-Scalar l-Scalar-Plain">common.namespace&quot; . }}-docker-registry-key&quot;</span>
</pre></div>
</code></pre></td></tr></table>
</div> <!-- class=content -->
<div id="lfcollabprojects-footer">
  <div class="gray-diagonal">
    <div class="footer-inner">
      <p>
        &copy; 2017 <a href="https://www.onap.org/">ONAP</a> a Linux Foundation
        Collaborative Project. All Rights Reserved.
      </p>
      <p>
        Linux Foundation is a registered trademark of The Linux Foundation.
        Linux is a registered
        <a
          href="http://www.linuxfoundation.org/programs/legal/trademark"
          title="Linux Mark Institute"
          >trademark</a
        >
        of Linus Torvalds.
      </p>
      <p>
        Please see our
        <a href="http://www.linuxfoundation.org/privacy">privacy policy</a> and
        <a href="http://www.linuxfoundation.org/terms">terms of use</a>
      </p>
    </div>
  </div>
</div>
</div> <!-- id=cgit -->
</body>
</html>
