mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Add WNodeFactory.MakeConfigMap,MakeSecret
This commit is contained in:
@@ -58,7 +58,7 @@ func (s k8sDataSetter) Filter(rn *RNode) (*RNode, error) {
|
||||
// test in a mapping field called "data" as a string. Pairs with a 'v'
|
||||
// failing this test go into a field called binaryData as a []byte.
|
||||
// TODO: support this distinction in kyaml with NodeTagBytes?
|
||||
return nil, fmt.Errorf(
|
||||
return nil, errors.Errorf(
|
||||
"key '%s' appears to have non-utf8 data; "+
|
||||
"binaryData field not yet supported", s.Key)
|
||||
}
|
||||
@@ -73,8 +73,8 @@ func (s k8sDataSetter) Filter(rn *RNode) (*RNode, error) {
|
||||
}
|
||||
v := NewScalarRNode(s.Value)
|
||||
v.YNode().Tag = NodeTagString
|
||||
// Add quotes?
|
||||
// v.YNode().Style = yaml.SingleQuotedStyle
|
||||
// TODO: use schema to determine node style and tag.
|
||||
// FormatNonStringStyle(v.YNode(), *k8sSch)
|
||||
_, err = rn.Pipe(
|
||||
LookupCreate(yaml.MappingNode, DataField), SetField(s.Key, v))
|
||||
return rn, err
|
||||
|
||||
@@ -39,8 +39,8 @@ data:
|
||||
fruit: apple
|
||||
veggie: celery
|
||||
`
|
||||
if output != expected {
|
||||
t.Fatalf("expected \n%s\nbut got \n%s\n", expected, output)
|
||||
if !assert.Equal(t, expected, output) {
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ metadata:
|
||||
name: foo
|
||||
namespace: bar
|
||||
`
|
||||
if output != expected {
|
||||
t.Fatalf("expected \n%s\nbut got \n%s\n", expected, output)
|
||||
if !assert.Equal(t, expected, output) {
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user