skip filtering resmap when the resource is a cluster level resource

This commit is contained in:
Jingfang Liu
2018-10-17 13:35:20 -07:00
parent 66bbae586f
commit 90c88d7f96
7 changed files with 139 additions and 25 deletions

View File

@@ -123,7 +123,11 @@ func (m ResMap) DeepCopy(rf *resource.Factory) ResMap {
// FilterBy returns a ResMap containing ResIds with the same namespace and nameprefix
// with the inputId
// If inputId is a cluster level resource, return the original resmap
func (m ResMap) FilterBy(inputId resid.ResId) ResMap {
if inputId.Gvk().IsClusterKind() {
return m
}
result := ResMap{}
for id, res := range m {
if id.Namespace() == inputId.Namespace() && id.HasSameLeftmostPrefix(inputId) {