From: Kiran Kamineni Date: Tue, 16 Apr 2019 19:07:51 +0000 (-0700) Subject: Rename plugin reference interface X-Git-Tag: 0.1.0~17 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=244578803033f17781b10be283aef43fa6f0aa60;p=multicloud%2Fk8s.git Rename plugin reference interface Rename the plugin interface to something more relevant. KubernetesResource will be used to describe resources for creation. Issue-ID: MULTICLOUD-557 Change-Id: I2fff5363b897b968e95b26257d8f26509fb567fd Signed-off-by: Kiran Kamineni --- diff --git a/src/k8splugin/internal/app/client.go b/src/k8splugin/internal/app/client.go index cd1ec8a2..9b8873cc 100644 --- a/src/k8splugin/internal/app/client.go +++ b/src/k8splugin/internal/app/client.go @@ -30,8 +30,8 @@ import ( "k8s.io/helm/pkg/tiller" ) -// KubernetesResource is the interface that is implemented -type KubernetesResource interface { +// PluginReference is the interface that is implemented +type PluginReference interface { Create(yamlFilePath string, namespace string, client *KubernetesClient) (string, error) Delete(kind string, name string, namespace string, client *KubernetesClient) error } @@ -125,9 +125,10 @@ func (k *KubernetesClient) createGeneric(kind string, files []string, namespace return nil, pkgerrors.Wrap(err, "No ExportedVariable symbol found") } - genericPlugin, ok := symbol.(KubernetesResource) + //Assert if it implements the PluginReference interface + genericPlugin, ok := symbol.(PluginReference) if !ok { - return nil, pkgerrors.New("ExportedVariable is not KubernetesResource type") + return nil, pkgerrors.New("ExportedVariable is not PluginReference type") } //Iterate over each file of a particular kind here @@ -244,10 +245,10 @@ func (k *KubernetesClient) deleteGeneric(kind string, resources []string, namesp return pkgerrors.Wrap(err, "No ExportedVariable symbol found") } - //Assert that it implements the KubernetesResource - genericPlugin, ok := symbol.(KubernetesResource) + //Assert that it implements the PluginReference interface + genericPlugin, ok := symbol.(PluginReference) if !ok { - return pkgerrors.New("ExportedVariable is not KubernetesResource type") + return pkgerrors.New("ExportedVariable is not PluginReference type") } for _, res := range resources {