diff options
Diffstat (limited to 'src/k8splugin/plugins/generic/plugin.go')
-rw-r--r-- | src/k8splugin/plugins/generic/plugin.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/k8splugin/plugins/generic/plugin.go b/src/k8splugin/plugins/generic/plugin.go index f3b2798a..9ecaf68c 100644 --- a/src/k8splugin/plugins/generic/plugin.go +++ b/src/k8splugin/plugins/generic/plugin.go @@ -21,7 +21,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/client-go/kubernetes/scheme" utils "k8splugin/internal" "k8splugin/internal/app" @@ -38,16 +37,11 @@ func (g genericPlugin) Create(yamlFilePath string, namespace string, client *app } //Decode the yaml file to create a runtime.Object - obj, err := utils.DecodeYAML(yamlFilePath, nil) - if err != nil { - return "", pkgerrors.Wrap(err, "Decode deployment object error") - } - - //Convert the runtime.Object to an unstructured Object unstruct := &unstructured.Unstructured{} - err = scheme.Scheme.Convert(obj, unstruct, nil) + //Ignore the returned obj as we expect the data in unstruct + _, err := utils.DecodeYAML(yamlFilePath, unstruct) if err != nil { - return "", pkgerrors.Wrap(err, "Converting to unstructured object") + return "", pkgerrors.Wrap(err, "Decode deployment object error") } dynClient := client.GetDynamicClient() |