Allow namespaced object to refer cluster level object

This commit is contained in:
Jingfang Liu
2019-01-14 15:44:22 -08:00
parent 73624da253
commit 38f0ca9f03
2 changed files with 62 additions and 1 deletions

View File

@@ -130,7 +130,7 @@ func (m ResMap) FilterBy(inputId resid.ResId) ResMap {
}
result := ResMap{}
for id, res := range m {
if id.Namespace() == inputId.Namespace() &&
if id.Gvk().IsClusterKind() || id.Namespace() == inputId.Namespace() &&
id.HasSameLeftmostPrefix(inputId) &&
id.HasSameRightmostSuffix(inputId) {
result[id] = res