aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin/internal/app/vnfhelper.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/k8splugin/internal/app/vnfhelper.go')
-rw-r--r--src/k8splugin/internal/app/vnfhelper.go18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/k8splugin/internal/app/vnfhelper.go b/src/k8splugin/internal/app/vnfhelper.go
index 5984bbd0..0a867090 100644
--- a/src/k8splugin/internal/app/vnfhelper.go
+++ b/src/k8splugin/internal/app/vnfhelper.go
@@ -70,23 +70,17 @@ func ensuresNamespace(namespace string, kubeclient kubernetes.Interface) error {
}
// CreateVNF reads the CSAR files from the files system and creates them one by one
-var CreateVNF = func(csarID string, cloudRegionID string, rbProfileID string, kubeclient *kubernetes.Clientset) (string, map[string][]string, error) {
+var CreateVNF = func(csarID string, cloudRegionID string, profile rb.Profile, kubeclient *kubernetes.Clientset) (string, map[string][]string, error) {
overrideValues := []string{}
- rbProfileClient := rb.NewProfileClient()
- rbProfile, err := rbProfileClient.Get(rbProfileID)
- if err != nil {
- return "", nil, pkgerrors.Wrap(err, "Error getting profile info")
- }
-
//Make sure that the namespace exists before trying to create any resources
- if err := ensuresNamespace(rbProfile.Namespace, kubeclient); err != nil {
- return "", nil, pkgerrors.Wrap(err, "Error while ensuring namespace: "+rbProfile.Namespace)
+ if err := ensuresNamespace(profile.Namespace, kubeclient); err != nil {
+ return "", nil, pkgerrors.Wrap(err, "Error while ensuring namespace: "+profile.Namespace)
}
externalVNFID := generateExternalVNFID()
- internalVNFID := cloudRegionID + "-" + rbProfile.Namespace + "-" + externalVNFID
+ internalVNFID := cloudRegionID + "-" + profile.Namespace + "-" + externalVNFID
- metaMap, err := rb.NewProfileClient().Resolve(rbProfileID, overrideValues)
+ metaMap, err := rb.NewProfileClient().Resolve(profile.RBName, profile.RBVersion, profile.Name, overrideValues)
if err != nil {
return "", nil, pkgerrors.Wrap(err, "Error resolving helm charts")
}
@@ -109,7 +103,7 @@ var CreateVNF = func(csarID string, cloudRegionID string, rbProfileID string, ku
//Populate the namespace from profile instead of instance body
genericKubeData := &utils.ResourceData{
YamlFilePath: filepath,
- Namespace: rbProfile.Namespace,
+ Namespace: profile.Namespace,
VnfId: internalVNFID,
}