From c9c8b012a027e7ff234ac3440620303374464665 Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Wed, 31 Jul 2019 11:48:19 -0700 Subject: Add static compile time check to plugins Add a static compile time check to plugins to make sure that any interface implementation mismatch is caught at compile time rather than runtime. Issue-ID: MULTICLOUD-666 Change-Id: I7f57774ad9384edb874cf64534f521014aea422f Signed-off-by: Kiran Kamineni --- src/k8splugin/plugins/network/plugin.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/k8splugin/plugins/network/plugin.go') diff --git a/src/k8splugin/plugins/network/plugin.go b/src/k8splugin/plugins/network/plugin.go index ca5aa959..49aedc53 100644 --- a/src/k8splugin/plugins/network/plugin.go +++ b/src/k8splugin/plugins/network/plugin.go @@ -14,9 +14,10 @@ limitations under the License. package main import ( - v1 "github.com/onap/multicloud-k8s/src/k8splugin/plugins/network/v1" "regexp" + v1 "github.com/onap/multicloud-k8s/src/k8splugin/plugins/network/v1" + utils "github.com/onap/multicloud-k8s/src/k8splugin/internal" "github.com/onap/multicloud-k8s/src/k8splugin/internal/helm" "github.com/onap/multicloud-k8s/src/k8splugin/internal/plugin" @@ -25,6 +26,9 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" ) +// Compile time check to see if networkPlugin implements the correct interface +var _ plugin.Reference = networkPlugin{} + // ExportedVariable is what we will look for when calling the plugin var ExportedVariable networkPlugin -- cgit 1.2.3-korg