[VOL-4798] log configuration for multiple stacks doesn't work

Change-Id: Idf40d7af1d53ba0d57ea7b4c07173e7455ca6321
diff --git a/VERSION b/VERSION
index 27f9cd3..a8fdfda 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.8.0
+1.8.1
diff --git a/internal/pkg/commands/log.go b/internal/pkg/commands/log.go
index fd05e70..6d89a17 100644
--- a/internal/pkg/commands/log.go
+++ b/internal/pkg/commands/log.go
@@ -20,6 +20,7 @@
 	"encoding/json"
 	"errors"
 	"fmt"
+	"os"
 	"strings"
 
 	flags "github.com/jessevdk/go-flags"
@@ -254,9 +255,15 @@
 		GlobalConfig.Current().KvStoreConfig.Timeout,
 		log.FatalLevel)
 	if err != nil {
-		return nil, nil, fmt.Errorf("Unable to create kvstore client %s", err)
+		return nil, nil, fmt.Errorf("unable to create kvstore client %s", err)
 	}
 
+	//voltha-helm-charts sets the KV_STORE_DATA_PREFIX env variable in the following format
+	//kv_store_data_prefix: 'service/{{ .Values.global.stack_name }}_voltha'
+	//set the KV_STORE_DATA_PREFIX using the current stack name to read correct configuration from KV.
+	if GlobalConfig.CurrentStack != "" {
+		os.Setenv("KV_STORE_DATAPATH_PREFIX", fmt.Sprintf("service/%s_voltha", GlobalConfig.CurrentStack))
+	}
 	cm := config.NewConfigManager(ctx, client, supportedKvStoreType, GlobalConfig.Current().KvStore, GlobalConfig.Current().KvStoreConfig.Timeout)
 	return cm, func() { client.Close(ctx) }, nil
 }