mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 02:20:53 +00:00
Confine calls to ApplyToJSON.
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"sigs.k8s.io/kustomize/api/resid"
|
||||
"sigs.k8s.io/kustomize/api/types"
|
||||
"sigs.k8s.io/kustomize/kyaml/filtersutil"
|
||||
"sigs.k8s.io/kustomize/kyaml/kio"
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
|
||||
@@ -422,9 +423,9 @@ func (r *Resource) ApplySmPatch(patch *Resource) error {
|
||||
return err
|
||||
}
|
||||
n, ns := r.GetName(), r.GetNamespace()
|
||||
err = filtersutil.ApplyToJSON(patchstrategicmerge.Filter{
|
||||
r.ApplyFilter(patchstrategicmerge.Filter{
|
||||
Patch: node,
|
||||
}, r)
|
||||
})
|
||||
if !r.IsEmpty() {
|
||||
r.SetName(n)
|
||||
r.SetNamespace(ns)
|
||||
@@ -432,6 +433,10 @@ func (r *Resource) ApplySmPatch(patch *Resource) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (r *Resource) ApplyFilter(f kio.Filter) error {
|
||||
return filtersutil.ApplyToJSON(f, r)
|
||||
}
|
||||
|
||||
func mergeStringMaps(maps ...map[string]string) map[string]string {
|
||||
result := map[string]string{}
|
||||
for _, m := range maps {
|
||||
|
||||
Reference in New Issue
Block a user