Rename plugin reference interface 07/85507/1
authorKiran Kamineni <kiran.k.kamineni@intel.com>
Tue, 16 Apr 2019 19:07:51 +0000 (12:07 -0700)
committerKiran Kamineni <kiran.k.kamineni@intel.com>
Tue, 16 Apr 2019 19:07:55 +0000 (12:07 -0700)
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 <kiran.k.kamineni@intel.com>
src/k8splugin/internal/app/client.go

index cd1ec8a..9b8873c 100644 (file)
@@ -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 {