mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
retain quotes in namespace transformer filter (#4421)
* check tag values for double quoting * reuse setentry * don't override single quotes in merge and fix cm generator immutable val * get rid of comment * starlark annotation tests * don't commit test image changes * set network to bool * isSet bool * updating e2e config tool * leave createtag * fn command failing unmarshal test * fn command test * don't set style in run-fs * use setentry to set tag * remove e2e test changes and make IsStringValue an RNode method
This commit is contained in:
committed by
GitHub
parent
fbfcb0479a
commit
7b0ec99d90
@@ -685,6 +685,12 @@ func (s FieldSetter) Filter(rn *RNode) (*RNode, error) {
|
||||
s.Value = NewScalarRNode(s.StringValue)
|
||||
}
|
||||
|
||||
// need to set style for strings not recognized by yaml 1.1 to quoted if not previously set
|
||||
// TODO: fix in upstream yaml library so this can be handled with yaml SetString
|
||||
if s.Value.IsStringValue() && !s.OverrideStyle && s.Value.YNode().Style == 0 && IsYaml1_1NonString(s.Value.YNode()) {
|
||||
s.Value.YNode().Style = yaml.DoubleQuotedStyle
|
||||
}
|
||||
|
||||
if s.Name == "" {
|
||||
if err := ErrorIfInvalid(rn, yaml.ScalarNode); err != nil {
|
||||
return rn, err
|
||||
|
||||
Reference in New Issue
Block a user