mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 00:52:55 +00:00
Handle null values while formatting
This commit is contained in:
@@ -45,6 +45,14 @@ func FormatNonStringStyle(node *Node, schema spec.Schema) {
|
||||
default:
|
||||
return
|
||||
}
|
||||
|
||||
// if the node tag is null, make sure we don't add any non-null tags
|
||||
// https://github.com/GoogleContainerTools/kpt/issues/2321
|
||||
if node.Tag == NodeTagNull {
|
||||
// must NOT quote null values
|
||||
node.Style = 0
|
||||
return
|
||||
}
|
||||
if tag, found := typeToTag[t]; found {
|
||||
// make sure the right tag is set
|
||||
node.Tag = tag
|
||||
|
||||
Reference in New Issue
Block a user