mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 00:52:55 +00:00
fix kyaml issue where dropping Style created issues
dropping the node style creates a compatibility issue where quotes around "on" are dropped because yaml.v3 interprets it as a string. other yaml parsers interpret on as a bool value, and parse it as a bool rather than string. fix: retain the original style so it is kept as quoted. - fmt: don't drop the styles - merge2: keep the style when merging elements - setting a field: if changing the value of a scalar field, retain its style by default
This commit is contained in:
@@ -146,9 +146,6 @@ func NewListRNode(values ...string) *RNode {
|
||||
|
||||
// NewRNode returns a new RNode pointer containing the provided Node.
|
||||
func NewRNode(value *yaml.Node) *RNode {
|
||||
if value != nil {
|
||||
value.Style = 0
|
||||
}
|
||||
return &RNode{value: value}
|
||||
}
|
||||
|
||||
@@ -389,7 +386,7 @@ const (
|
||||
Flow = "Flow"
|
||||
)
|
||||
|
||||
// String returns a string valuer for a Node, applying the supplied formatting options
|
||||
// String returns a string value for a Node, applying the supplied formatting options
|
||||
func String(node *yaml.Node, opts ...string) (string, error) {
|
||||
if node == nil {
|
||||
return "", nil
|
||||
|
||||
Reference in New Issue
Block a user