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:
Shoshana Malfatto
2022-03-23 14:25:19 -07:00
committed by GitHub
parent fbfcb0479a
commit 7b0ec99d90
14 changed files with 95 additions and 18 deletions

View File

@@ -135,9 +135,14 @@ func (r *RunFnRunner) getContainerFunctions(c *cobra.Command, dataItems []string
return nil, err
}
if r.Network {
n := &yaml.Node{
Kind: yaml.ScalarNode,
Value: "true",
Tag: yaml.NodeTagBool,
}
err = fn.PipeE(
yaml.Lookup("container"),
yaml.SetField("network", yaml.NewScalarRNode("true")))
yaml.SetField("network", yaml.NewRNode(n)))
if err != nil {
return nil, err
}
@@ -231,7 +236,9 @@ data: {}
if len(kv) != 2 {
return nil, fmt.Errorf("args must have keys and values separated by =")
}
err := dataField.PipeE(yaml.SetField(kv[0], yaml.NewScalarRNode(kv[1])))
// do not set style since function should determine tag and style
err := dataField.PipeE(
yaml.FieldSetter{Name: kv[0], Value: yaml.NewScalarRNode(kv[1]), OverrideStyle: true})
if err != nil {
return nil, err
}