mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Move yaml check to file in which it is called.
This commit is contained in:
@@ -19,6 +19,7 @@ package kunstruct
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io"
|
"io"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||||
"k8s.io/apimachinery/pkg/util/yaml"
|
"k8s.io/apimachinery/pkg/util/yaml"
|
||||||
@@ -60,6 +61,10 @@ func (kf *KunstructurerFactoryImpl) SliceFromBytes(
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isEmptyYamlError(err error) bool {
|
||||||
|
return strings.Contains(err.Error(), "is missing in 'null'")
|
||||||
|
}
|
||||||
|
|
||||||
// FromMap returns an instance of Kunstructured.
|
// FromMap returns an instance of Kunstructured.
|
||||||
func (kf *KunstructurerFactoryImpl) FromMap(
|
func (kf *KunstructurerFactoryImpl) FromMap(
|
||||||
m map[string]interface{}) ifc.Kunstructured {
|
m map[string]interface{}) ifc.Kunstructured {
|
||||||
|
|||||||
@@ -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)
|
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'")
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user