diff options
author | Konrad Bańka <k.banka@samsung.com> | 2019-07-22 15:48:31 +0200 |
---|---|---|
committer | Konrad Bańka <k.banka@samsung.com> | 2019-07-22 15:48:31 +0200 |
commit | bb6e23a2fb0f83bbb2b5f5c31afff83448ae8d8b (patch) | |
tree | 0c045b1d68068338e76593ef10ebcc7b67cbe091 /src/k8splugin/plugins | |
parent | 71a2a9c8b8c77cee67571549a06c96ceb3781077 (diff) |
Adapt network plugin to interface restrictions
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 <k.banka@samsung.com>
Change-Id: Ic619ad476dba5e6582759290e18edceaa98c332f
Diffstat (limited to 'src/k8splugin/plugins')
-rw-r--r-- | src/k8splugin/plugins/network/plugin.go | 10 |
1 files changed, 5 insertions, 5 deletions
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 { |