diff options
author | Victor Morales <victor.morales@intel.com> | 2018-09-25 03:32:37 -0700 |
---|---|---|
committer | Victor Morales <victor.morales@intel.com> | 2018-09-25 03:32:37 -0700 |
commit | b7e7f8f659439ac1db7b42ad47828def65eb094c (patch) | |
tree | 6f3766a9b67d9cac099bee6edad83ac7d60ee5bb /src/k8splugin | |
parent | 655dfbea5a836f83a46e5e5d038f0d4180803ee7 (diff) |
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 <victor.morales@intel.com>
Issue-ID: MULTICLOUD-301
Diffstat (limited to 'src/k8splugin')
-rw-r--r-- | src/k8splugin/csar/parser.go | 11 |
1 files changed, 7 insertions, 4 deletions
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") } |