add namespace to id when create resmap from files

This commit is contained in:
Jingfang Liu
2018-10-17 10:46:57 -07:00
parent bad3ccddc3
commit 14fc54e323
4 changed files with 45 additions and 5 deletions

View File

@@ -58,7 +58,8 @@ func (r *Resource) IsGenerated() bool {
// Id returns the ResId for the resource.
func (r *Resource) Id() resid.ResId {
return resid.NewResId(r.GetGvk(), r.GetName())
namespace, _ := r.GetFieldValue("metadata.namespace")
return resid.NewResIdWithPrefixNamespace(r.GetGvk(), r.GetName(), "", namespace)
}
// Merge performs merge with other resource.