From a823f3043f68ff3a0566b99899a85442fed8a49e Mon Sep 17 00:00:00 2001 From: Justin SB Date: Sun, 15 Nov 2020 13:05:27 -0500 Subject: [PATCH] Expand rnode function comments to point to multi-object options. The rnode Parse and ReadFile functions only return a single object; suggest kio.ByteReader for the case of parsing multiple objects. --- kyaml/yaml/rnode.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kyaml/yaml/rnode.go b/kyaml/yaml/rnode.go index 1e47a5d7c..5ff5bf765 100644 --- a/kyaml/yaml/rnode.go +++ b/kyaml/yaml/rnode.go @@ -50,12 +50,14 @@ func GetValue(node *RNode) string { return node.YNode().Value } -// Parse parses a yaml string into an *RNode +// Parse parses a yaml string into an *RNode. +// To parse multiple resources, consider a kio.ByteReader func Parse(value string) (*RNode, error) { return Parser{Value: value}.Filter(nil) } -// ReadFile parses a single Resource from a yaml file +// ReadFile parses a single Resource from a yaml file. +// To parse multiple resources, consider a kio.ByteReader func ReadFile(path string) (*RNode, error) { b, err := ioutil.ReadFile(path) if err != nil {