diff options
author | Ritu Sood <ritu.sood@intel.com> | 2018-11-10 03:54:15 +0000 |
---|---|---|
committer | Victor Morales <victor.morales@intel.com> | 2018-12-05 16:26:56 -0800 |
commit | a1abd829315d72adb258da20470eaa2445cf3e32 (patch) | |
tree | a1c2ae3e61490241b0a4c93f49acffd6d319a7a4 /src/k8splugin/krd | |
parent | daf3a00798ee77e469cd89cb16ade818c50968f9 (diff) |
Add Network and OVN4NFV Plugins
This patch includes support for Network Objects through a new plugin.
It also add the first sub-module plugin for OVN4NFVK8s support.
Change-Id: Ia23c42d50f75a5206e1b6a04052c34e940518428
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-ID: MULTICLOUD-303
Diffstat (limited to 'src/k8splugin/krd')
-rw-r--r-- | src/k8splugin/krd/plugins.go | 4 | ||||
-rw-r--r-- | src/k8splugin/krd/plugins_test.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/k8splugin/krd/plugins.go b/src/k8splugin/krd/plugins.go index 9ccb04fa..1086a2bb 100644 --- a/src/k8splugin/krd/plugins.go +++ b/src/k8splugin/krd/plugins.go @@ -37,7 +37,7 @@ type ResourceData struct { } // DecodeYAML reads a YAMl file to extract the Kubernetes object definition -var DecodeYAML = func(path string) (runtime.Object, error) { +var DecodeYAML = func(path string, into runtime.Object) (runtime.Object, error) { if _, err := os.Stat(path); err != nil { if os.IsNotExist(err) { return nil, pkgerrors.New("File " + path + " not found") @@ -54,7 +54,7 @@ var DecodeYAML = func(path string) (runtime.Object, error) { log.Println("Decoding deployment YAML") decode := scheme.Codecs.UniversalDeserializer().Decode - obj, _, err := decode(rawBytes, nil, nil) + obj, _, err := decode(rawBytes, nil, into) if err != nil { return nil, pkgerrors.Wrap(err, "Deserialize YAML error") } diff --git a/src/k8splugin/krd/plugins_test.go b/src/k8splugin/krd/plugins_test.go index 81d2784e..46499adb 100644 --- a/src/k8splugin/krd/plugins_test.go +++ b/src/k8splugin/krd/plugins_test.go @@ -70,7 +70,7 @@ func TestDecodeYAML(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.label, func(t *testing.T) { - result, err := DecodeYAML(testCase.input) + result, err := DecodeYAML(testCase.input, nil) if err != nil { if testCase.expectedError == "" { t.Fatalf("Decode YAML method return an un-expected (%s)", err) |