mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 00:52:55 +00:00
Kyaml api cleanup
This commit is contained in:
@@ -176,12 +176,6 @@ func (r *ByteReader) Read() ([]*yaml.RNode, error) {
|
||||
return output, nil
|
||||
}
|
||||
|
||||
func isEmptyDocument(node *yaml.Node) bool {
|
||||
// node is a Document with no content -- e.g. "---\n---"
|
||||
return node.Kind == yaml.DocumentNode &&
|
||||
node.Content[0].Tag == yaml.NodeTagNull
|
||||
}
|
||||
|
||||
func (r *ByteReader) decode(index int, decoder *yaml.Decoder) (*yaml.RNode, error) {
|
||||
node := &yaml.Node{}
|
||||
err := decoder.Decode(node)
|
||||
@@ -192,7 +186,7 @@ func (r *ByteReader) decode(index int, decoder *yaml.Decoder) (*yaml.RNode, erro
|
||||
return nil, errors.Wrap(err)
|
||||
}
|
||||
|
||||
if isEmptyDocument(node) {
|
||||
if yaml.IsYNodeEmptyDoc(node) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user