Gather and use some of the kyaml constants.

This commit is contained in:
jregan
2020-11-16 21:26:18 -08:00
parent 2ae180ca23
commit 712276176c
4 changed files with 66 additions and 31 deletions

View File

@@ -14,18 +14,6 @@ import (
"sigs.k8s.io/kustomize/kyaml/errors"
)
const (
// NodeTagNull is the tag set for a yaml.Document that contains no data;
// e.g. it isn't a Map, Slice, Document, etc
NodeTagNull = "!!null"
NodeTagFloat = "!!float"
NodeTagString = "!!str"
NodeTagBool = "!!bool"
NodeTagInt = "!!int"
NodeTagMap = "!!map"
NodeTagSeq = "!!seq"
NodeTagEmpty = ""
)
// MakeNullNode returns an RNode that represents an empty document.
func MakeNullNode() *RNode {
@@ -184,17 +172,6 @@ func (rn *RNode) Copy() *RNode {
var ErrMissingMetadata = fmt.Errorf("missing Resource metadata")
// Field names
const (
AnnotationsField = "annotations"
APIVersionField = "apiVersion"
KindField = "kind"
MetadataField = "metadata"
NameField = "name"
NamespaceField = "namespace"
LabelsField = "labels"
)
// IsNil is true if the node is nil, or its underlying YNode is nil.
func (rn *RNode) IsNil() bool {
return rn == nil || rn.YNode() == nil