From a10053b3d24625d32a3604e4b18097c2d03d0866 Mon Sep 17 00:00:00 2001
From: bravof <fbravo@whitestack.com>
Date: Wed, 8 Jul 2020 14:37:28 -0400
Subject: [PATCH] fix(config volumes): config volumes shared only between pods
 in the same EE, using VNFID as sub-folder for the hostPath

Signed-off-by: bravof <fbravo@whitestack.com>
---
 .../eechart/charts/snmpexporter/templates/deployment.yaml      | 2 +-
 snmp_ee_vnf/helm-charts/eechart/templates/statefulset.yaml     | 2 +-
 snmp_ee_vnf/helm-charts/eechart/values.yaml                    | 3 +++
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/deployment.yaml b/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/deployment.yaml
index e3f290e3..e037f05f 100644
--- a/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/deployment.yaml
+++ b/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/deployment.yaml
@@ -47,7 +47,7 @@ spec:
       volumes:
         - name: config-volume
           hostPath: 
-            path: /var/lib/osm/snmp_exporter
+            path: "/var/lib/osm/snmp_exporter/{{ .Values.global.vnf_id }}/"
         - name: init-config-volume
           configMap:
             name: snmp-init-config
diff --git a/snmp_ee_vnf/helm-charts/eechart/templates/statefulset.yaml b/snmp_ee_vnf/helm-charts/eechart/templates/statefulset.yaml
index 8177d713..1d175111 100755
--- a/snmp_ee_vnf/helm-charts/eechart/templates/statefulset.yaml
+++ b/snmp_ee_vnf/helm-charts/eechart/templates/statefulset.yaml
@@ -49,7 +49,7 @@ spec:
           name:  {{ include "eechart.fullname" . }}
       - name: snmp-config-volume
         hostPath: 
-          path: /var/lib/osm/snmp_exporter
+          path: "/var/lib/osm/snmp_exporter/{{ .Values.global.vnf_id }}/"
       - name: vnf-mibs
         configMap:
           name: vnf-snmp-mibs
diff --git a/snmp_ee_vnf/helm-charts/eechart/values.yaml b/snmp_ee_vnf/helm-charts/eechart/values.yaml
index 84cb21b7..45f253f9 100755
--- a/snmp_ee_vnf/helm-charts/eechart/values.yaml
+++ b/snmp_ee_vnf/helm-charts/eechart/values.yaml
@@ -1,3 +1,6 @@
+global:
+  vnf_id: AVNFId
+
 # Default values for eechart.
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
-- 
GitLab