From b7e7f8f659439ac1db7b42ad47828def65eb094c Mon Sep 17 00:00:00 2001 From: Victor Morales Date: Tue, 25 Sep 2018 03:32:37 -0700 Subject: Fix ensure Namespace function The I1e1eb40f1a18ba33c74069a117462c8df17767ac change standarizes the Interface for the plugins, this changes affects callers and it's necessary to update those references. This change fix that issue for Namespace Kubernetes resources. Change-Id: I04c957fdd526401523b72e332b6e24385a7ceefe Signed-off-by: Victor Morales Issue-ID: MULTICLOUD-301 --- src/k8splugin/csar/parser.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/k8splugin/csar') diff --git a/src/k8splugin/csar/parser.go b/src/k8splugin/csar/parser.go index 6cb07fc2..c0dd6a79 100644 --- a/src/k8splugin/csar/parser.go +++ b/src/k8splugin/csar/parser.go @@ -23,7 +23,7 @@ import ( "k8s.io/client-go/kubernetes" pkgerrors "github.com/pkg/errors" - "gopkg.in/yaml.v2" + yaml "gopkg.in/yaml.v2" "k8splugin/krd" ) @@ -46,7 +46,7 @@ func ensuresNamespace(namespace string, kubeclient kubernetes.Interface) error { } ns, err := symGetNamespaceFunc.(func(string, string, kubernetes.Interface) (string, error))( - namespace, "", kubeclient) + namespace, namespace, kubeclient) if err != nil { return pkgerrors.Wrap(err, "An error ocurred during the get namespace execution") } @@ -57,9 +57,12 @@ func ensuresNamespace(namespace string, kubeclient kubernetes.Interface) error { if err != nil { return pkgerrors.Wrap(err, "Error fetching create namespace plugin") } + namespaceResource := &krd.ResourceData{ + Namespace: namespace, + } - err = symGetNamespaceFunc.(func(string, kubernetes.Interface) error)( - namespace, kubeclient) + _, err = symGetNamespaceFunc.(func(*krd.ResourceData, kubernetes.Interface) (string, error))( + namespaceResource, kubeclient) if err != nil { return pkgerrors.Wrap(err, "Error creating "+namespace+" namespace") } -- cgit 1.2.3-korg