mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 01:39:06 +00:00
filter by namespace and nameprefix in namereference transformer
This commit is contained in:
@@ -140,6 +140,18 @@ func (m ResMap) insert(newName string, obj *unstructured.Unstructured) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// FilterBy returns a ResMap containing ResIds with the same namespace and nameprefix
|
||||
// with the inputId
|
||||
func (m ResMap) FilterBy(inputId resource.ResId) ResMap {
|
||||
result := ResMap{}
|
||||
for id, res := range m {
|
||||
if id.Namespace() == inputId.Namespace() && id.HasSamePrefix(inputId) {
|
||||
result[id] = res
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// NewResourceSliceFromPatches returns a slice of resources given a patch path slice from a kustomization file.
|
||||
func NewResourceSliceFromPatches(
|
||||
loader loader.Loader, paths []patch.PatchStrategicMerge) ([]*resource.Resource, error) {
|
||||
|
||||
Reference in New Issue
Block a user