mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 18:10:59 +00:00
update PruneString for resources
This commit is contained in:
@@ -205,13 +205,3 @@ func (n ResId) prefixList() []string {
|
||||
func (n ResId) suffixList() []string {
|
||||
return strings.Split(n.suffix, ":")
|
||||
}
|
||||
|
||||
// PruneString returns a string which can be used
|
||||
// as a key in a Prune ConfigMap
|
||||
func (n ResId) PruneString() string {
|
||||
name := n.prefix + n.name + n.suffix
|
||||
return n.gvKind.Group +
|
||||
"_" + n.gvKind.Kind +
|
||||
"_" + n.namespace +
|
||||
"_" + name
|
||||
}
|
||||
|
||||
@@ -89,7 +89,11 @@ func (r *Resource) Merge(other *Resource) {
|
||||
}
|
||||
|
||||
func (r *Resource) PruneString() string {
|
||||
return r.Id().PruneString()
|
||||
namespace, _ := r.GetFieldValue("metadata.namespace")
|
||||
return r.GetGvk().Group +
|
||||
"_" + r.GetGvk().Kind +
|
||||
"_" + namespace +
|
||||
"_" + r.GetName()
|
||||
}
|
||||
|
||||
// Replace performs replace with other resource.
|
||||
|
||||
Reference in New Issue
Block a user