aboutsummaryrefslogtreecommitdiffstats
path: root/src/orchestrator/pkg
diff options
context:
space:
mode:
authorRajamohan Raj <rajamohan.raj@intel.com>2020-04-03 07:43:11 +0000
committerRitu Sood <Ritu.Sood@intel.com>2020-04-13 16:46:10 +0000
commitc8ba8f21b68b64b4068f188614dd7c891edf035f (patch)
treebf7b48d32552a60b6635204c49fd2a3f7665e310 /src/orchestrator/pkg
parent502b61039dbdc9089768a49b87163e654d8cbfb7 (diff)
Test cases for resolving the helm templates
Added test cases for overriding values and resolving the helm charts. Also addressed the merge conflicts and review comments Issue-ID: MULTICLOUD-1041 Signed-off-by: Rajamohan Raj <rajamohan.raj@intel.com> Change-Id: I511e8e2e71c60e878df434370fc053f09cda1f66
Diffstat (limited to 'src/orchestrator/pkg')
-rw-r--r--src/orchestrator/pkg/module/instantiation.go7
-rw-r--r--src/orchestrator/pkg/rtcontext/rtcontext_test.go4
2 files changed, 5 insertions, 6 deletions
diff --git a/src/orchestrator/pkg/module/instantiation.go b/src/orchestrator/pkg/module/instantiation.go
index 3c704181..5fabe81e 100644
--- a/src/orchestrator/pkg/module/instantiation.go
+++ b/src/orchestrator/pkg/module/instantiation.go
@@ -20,7 +20,6 @@ import (
"fmt"
"github.com/onap/multicloud-k8s/src/orchestrator/utils/helm"
- "github.com/onap/multicloud-k8s/src/orchestrator/utils/types"
pkgerrors "github.com/pkg/errors"
"encoding/base64"
@@ -67,11 +66,11 @@ func getOverrideValuesByAppName(ov []OverrideValues, a string) map[string]string
// GetSortedTemplateForApp returns the sorted templates.
//It takes in arguments - appName, project, compositeAppName, releaseName, compositeProfileName, array of override values
-func GetSortedTemplateForApp(appName, p, ca, v, rName, cp string, overrideValues []OverrideValues) ([]types.KubernetesResourceTemplate, error) {
+func GetSortedTemplateForApp(appName, p, ca, v, rName, cp string, overrideValues []OverrideValues) ([]helm.KubernetesResourceTemplate, error) {
log.Println("Processing App.. ", appName)
- var sortedTemplates []types.KubernetesResourceTemplate
+ var sortedTemplates []helm.KubernetesResourceTemplate
aC, err := NewAppClient().GetAppContent(appName, p, ca, v)
if err != nil {
@@ -107,7 +106,7 @@ func GetSortedTemplateForApp(appName, p, ca, v, rName, cp string, overrideValues
sortedTemplates, err = helm.NewTemplateClient("", "default", rName,
ManifestFileName).Resolve(appContent,
appProfileContent, overrideValuesOfAppStr,
- rName, appName)
+ appName)
log.Printf("The len of the sortedTemplates :: %d", len(sortedTemplates))
diff --git a/src/orchestrator/pkg/rtcontext/rtcontext_test.go b/src/orchestrator/pkg/rtcontext/rtcontext_test.go
index e9610ef0..eedbeb82 100644
--- a/src/orchestrator/pkg/rtcontext/rtcontext_test.go
+++ b/src/orchestrator/pkg/rtcontext/rtcontext_test.go
@@ -59,7 +59,7 @@ func (c *MockContextDb) Delete(key string) error {
// Delete all function
func (c *MockContextDb) DeleteAll(key string) error {
- for kvKey, _ := range c.Items {
+ for kvKey := range c.Items {
delete(c.Items, kvKey)
}
return c.Err
@@ -69,7 +69,7 @@ func (c *MockContextDb) DeleteAll(key string) error {
func (c *MockContextDb) GetAllKeys(path string) ([]string, error) {
var keys []string
- for k, _ := range c.Items {
+ for k := range c.Items {
keys = append(keys, string(k))
}
return keys, c.Err