Merge pull request #989 from Liujingfang1/prune

update PruneString for resources
This commit is contained in:
Kubernetes Prow Robot
2019-04-18 10:54:02 -07:00
committed by GitHub
4 changed files with 10 additions and 16 deletions

View File

@@ -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
}

View File

@@ -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.