mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Make filed optional flag for create setter
This commit is contained in:
@@ -55,8 +55,9 @@ func (m *customFieldSetter) Filter(object *yaml.RNode) (*yaml.RNode, error) {
|
||||
return node.PipeE(m)
|
||||
})
|
||||
case yaml.ScalarNode:
|
||||
// only create the setter for fields with the given name
|
||||
if m.currentFieldName != m.Field {
|
||||
// if filed is empty, create the setter for all fields with given value
|
||||
// else only create the setter for given field and value combination, with given name
|
||||
if m.Field != "" && m.currentFieldName != m.Field {
|
||||
return object, nil
|
||||
}
|
||||
if err := m.create(object); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user