From dcc9c4d31a81cdcd35602eb5fdcab651d4f3ec45 Mon Sep 17 00:00:00 2001 From: jregan Date: Mon, 15 Oct 2018 09:20:01 -0700 Subject: [PATCH] Move yaml check to file in which it is called. --- internal/k8sdeps/kunstruct/factory.go | 5 +++++ internal/k8sdeps/kunstruct/kunstruct.go | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/k8sdeps/kunstruct/factory.go b/internal/k8sdeps/kunstruct/factory.go index c1d130f9f..8d0058951 100644 --- a/internal/k8sdeps/kunstruct/factory.go +++ b/internal/k8sdeps/kunstruct/factory.go @@ -19,6 +19,7 @@ package kunstruct import ( "bytes" "io" + "strings" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/yaml" @@ -60,6 +61,10 @@ func (kf *KunstructurerFactoryImpl) SliceFromBytes( return result, nil } +func isEmptyYamlError(err error) bool { + return strings.Contains(err.Error(), "is missing in 'null'") +} + // FromMap returns an instance of Kunstructured. func (kf *KunstructurerFactoryImpl) FromMap( m map[string]interface{}) ifc.Kunstructured { diff --git a/internal/k8sdeps/kunstruct/kunstruct.go b/internal/k8sdeps/kunstruct/kunstruct.go index 968597707..922aead81 100644 --- a/internal/k8sdeps/kunstruct/kunstruct.go +++ b/internal/k8sdeps/kunstruct/kunstruct.go @@ -104,7 +104,3 @@ func getFieldValue(m map[string]interface{}, pathToField []string) (string, erro return "", fmt.Errorf("%#v is not expected to be a primitive type", typedV) } } - -func isEmptyYamlError(err error) bool { - return strings.Contains(err.Error(), "is missing in 'null'") -}