mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
added count for creating setters
This commit is contained in:
@@ -37,6 +37,9 @@ type Add struct {
|
||||
|
||||
// Type is the type of the setter value
|
||||
Type string
|
||||
|
||||
// Count is the number of fields the setter applies to
|
||||
Count int
|
||||
}
|
||||
|
||||
// Filter implements yaml.Filter
|
||||
@@ -104,6 +107,7 @@ func (a *Add) visitScalar(object *yaml.RNode, p string, _ *openapi.ResourceSchem
|
||||
if a.FieldValue != "" && a.FieldValue != object.YNode().Value {
|
||||
return nil
|
||||
}
|
||||
a.Count++
|
||||
return a.addRef(object)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user