We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee3f506 commit 97c8cd7Copy full SHA for 97c8cd7
kyaml/yaml/rnode.go
@@ -450,15 +450,13 @@ func (rn *RNode) getMetaData() *yaml.Node {
450
if IsMissingOrNull(rn) {
451
return nil
452
}
453
- var n *RNode
+ content := rn.Content()
454
if rn.YNode().Kind == DocumentNode {
455
// get the content if this is the document node
456
- n = NewRNode(rn.Content()[0])
457
- } else {
458
- n = rn
+ content = content[0].Content
459
460
var mf *yaml.Node
461
- visitMappingNodeFields(n.Content(), func(key, value *yaml.Node) {
+ visitMappingNodeFields(content, func(key, value *yaml.Node) {
462
if !IsYNodeNilOrEmpty(value) {
463
mf = value
464
0 commit comments