mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 18:10:59 +00:00
allow general name and kind changes via an options field in patches
This commit is contained in:
@@ -41,7 +41,8 @@ func (rf *Factory) FromMapWithName(n string, m map[string]interface{}) *Resource
|
||||
|
||||
// FromMapWithNamespaceAndName returns a new instance with the given "original" namespace.
|
||||
func (rf *Factory) FromMapWithNamespaceAndName(ns string, n string, m map[string]interface{}) *Resource {
|
||||
return rf.makeOne(rf.kf.FromMap(m), nil).setPreviousNamespaceAndName(ns, n)
|
||||
r := rf.makeOne(rf.kf.FromMap(m), nil)
|
||||
return r.setPreviousId(ns, n, r.GetKind())
|
||||
}
|
||||
|
||||
// FromMapAndOption returns a new instance of Resource with given options.
|
||||
@@ -157,7 +158,7 @@ func (rf *Factory) SliceFromBytesWithNames(names []string, in []byte) ([]*Resour
|
||||
return nil, fmt.Errorf("number of names doesn't match number of resources")
|
||||
}
|
||||
for i, res := range result {
|
||||
res.setPreviousNamespaceAndName(resid.DefaultNamespace, names[i])
|
||||
res.setPreviousId(resid.DefaultNamespace, names[i], res.GetKind())
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user