From bb6e23a2fb0f83bbb2b5f5c31afff83448ae8d8b Mon Sep 17 00:00:00 2001 From: Konrad Bańka Date: Mon, 22 Jul 2019 15:48:31 +0200 Subject: Adapt network plugin to interface restrictions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Network plugin was not fully compliant with interface it should implement due to type of one function argument. Relevant functions have been adapted to utilize proper types. Issue-ID: MULTICLOUD-708 Signed-off-by: Konrad Bańka Change-Id: Ic619ad476dba5e6582759290e18edceaa98c332f --- src/k8splugin/plugins/network/plugin.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/k8splugin/plugins/network/plugin.go b/src/k8splugin/plugins/network/plugin.go index e69a075b..ca5aa959 100644 --- a/src/k8splugin/plugins/network/plugin.go +++ b/src/k8splugin/plugins/network/plugin.go @@ -18,8 +18,8 @@ import ( "regexp" utils "github.com/onap/multicloud-k8s/src/k8splugin/internal" - "github.com/onap/multicloud-k8s/src/k8splugin/internal/app" "github.com/onap/multicloud-k8s/src/k8splugin/internal/helm" + "github.com/onap/multicloud-k8s/src/k8splugin/internal/plugin" pkgerrors "github.com/pkg/errors" "k8s.io/apimachinery/pkg/runtime/schema" @@ -43,7 +43,7 @@ func extractData(data string) (cniType, networkName string) { } // Create an ONAP Network object -func (p networkPlugin) Create(yamlFilePath string, namespace string, client *app.KubernetesClient) (string, error) { +func (p networkPlugin) Create(yamlFilePath string, namespace string, client plugin.KubernetesConnector) (string, error) { network := &v1.OnapNetwork{} if _, err := utils.DecodeYAML(yamlFilePath, network); err != nil { return "", pkgerrors.Wrap(err, "Decode network object error") @@ -69,19 +69,19 @@ func (p networkPlugin) Create(yamlFilePath string, namespace string, client *app } // Get a Network -func (p networkPlugin) Get(resource helm.KubernetesResource, namespace string, client *app.KubernetesClient) (string, error) { +func (p networkPlugin) Get(resource helm.KubernetesResource, namespace string, client plugin.KubernetesConnector) (string, error) { return "", nil } // List of Networks func (p networkPlugin) List(gvk schema.GroupVersionKind, namespace string, - client *app.KubernetesClient) ([]helm.KubernetesResource, error) { + client plugin.KubernetesConnector) ([]helm.KubernetesResource, error) { return nil, nil } // Delete an existing Network -func (p networkPlugin) Delete(resource helm.KubernetesResource, namespace string, client *app.KubernetesClient) error { +func (p networkPlugin) Delete(resource helm.KubernetesResource, namespace string, client plugin.KubernetesConnector) error { cniType, networkName := extractData(resource.Name) typePlugin, ok := utils.LoadedPlugins[cniType+"-network"] if !ok { -- cgit 1.2.3-korg